码迷,mamicode.com
首页 > Web开发 > 详细

PHP判断是否都是中文

时间:2016-06-23 12:22:42      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

 1 /**
 2  * 判断是否都是中文
 3  * @param $str
 4  * @return int
 5  */
 6 public static function IsAllChinese($str)
 7 {
 8     $len = preg_match(‘/^[\x{4e00}-\x{9fa5}]+$/u‘,$str);
 9     if ($len)
10     {
11         return true;
12     }
13     return false;
14 }

PHP判断是否都是中文

标签:

原文地址:http://www.cnblogs.com/diguaer/p/5609938.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!