/*
可用于用户名等不允许使用出现中文字符的地方
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;
}
}