php中英文判断
$str = '中国';
if (preg_match("/^[\x7f-\xff]+$/", $str))
{ //兼容gb2312,utf-8
echo "zhongwen";
}
else
{
echo "yingwen ";
}
作者“技术人生”
补充:Web开发 , php ,
$str = '中国';
if (preg_match("/^[\x7f-\xff]+$/", $str))
{ //兼容gb2312,utf-8
echo "zhongwen";
}
else
{
echo "yingwen ";
}
作者“技术人生”
补充:Web开发 , php ,