正则提取汉字字符

来源:互联网 发布:mac 软键盘 编辑:程序博客网 时间:2024/05/19 09:02





$data = array('data'=>$topic_info['title']);  //定义参数        $data = @http_build_query($data);  //把参数转换成URL数据        $aContext = array('http' => array('method' => 'POST',            'header'  => 'Content-type: application/x-www-form-urlencoded',            'content' => $data ));        $cxContext  = stream_context_create($aContext);        $sUrl = 'http://www.xunsearch.com/scws/api.php'; //此处必须为完整路径        $d = @file_get_contents($sUrl,false,$cxContext);        $cn = "/[\x{4e00}-\x{9fff}]+/u";        preg_match_all($cn,$d,$return);        //var_dump($return[0][0]);        var_dump($d);



0 0
原创粉丝点击