php正则字符串提取汉字

/*$str 为输入、输出字符串变量*/
preg_match_all('/[\x{4e00}-\x{9fff}]+/u', $str, $matches);
$str = join('', $matches[0]);

 

posted @ 2018-07-01 19:12  孤舟残月浅笑嫣然  阅读(421)  评论(0编辑  收藏  举报