135-1821-9792

php正则去掉字符串中非汉字字符串

$str='2016,北京欢迎您 from around you..';

preg_match_all('/[\x{4e00}-\x{9fff}]+/u', $str, $matches);


$str = join('', $matches[0]);

//输出

北京欢迎您

当前名称:php正则去掉字符串中非汉字字符串
网址分享:http://kswsj.com/article/jjioig.html

其他资讯



Copyright © 2009-2022 www.kswsj.com 成都快上网科技有限公司 版权所有 蜀ICP备19037934号