iscn-判断是否有包括中文的字符串

/*
可用于用户名等不允许使用出现中文字符的地方
itlearner整理发布
*/
$str = “dd*(*d”;
if (iscn($str)) {
echo “包括中文的字符串”;
} else {
echo “不包括中文的字符串”;
}

function iscn($str){
if (preg_match(“/.*[".chr(0xa1)."-".chr(0xff)."]+.*/”, $str)) {
return true;
} else {
return false;
}
}

Popularity: 11%

No Responses to “iscn-判断是否有包括中文的字符串”

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>