时间:2021-07-01 10:21:17 帮助过:4人阅读
static function ischinese($s){ $allen = preg_match("/^[^/x80-/xff]+$/", $s); //判断是否是英文 $allcn = preg_match("/^[".chr(0xa1)."-".chr(0xff)."]+$/",$s); //判断是否是中文 if($allen){ return 'allen'; }else{ if($allcn){ return 'allcn'; }else{ return 'encn'; } } }
http://www.bkjia.com/PHPjc/996655.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/996655.htmlTechArticlePHP判断是中文还是英文, static function ischinese( $s ){ $allen = preg_match ("/^[^/x80-/xff]+$/", $s ); // 判断是否是英文 $allcn = preg_match ("/^[". chr (0xa1)."...