正则匹配中文

//如果只想匹配中文,中文的ASI编码为[u4e00-u9fa5]
$str = preg_replace("/[\x{4e00}-\x{9fa5}]/iu","zh",$str); 

 

posted @ 2015-03-12 21:29  leezhxing  阅读(584)  评论(0编辑  收藏  举报