$str = ‘中国’;
if (preg_match(“/^[\x7f-\xff]+$/”, $str))
{ //兼容gb2312,utf-8
echo “zhongwen”;
}
else
{
echo “yingwen “;
}
作者“技术人生”