$str = 'China';
if (preg_match("/^[x7f-xff]+$/", $str))
{ //Compatible with gb2312,utf-8
echo "zhongwen";
}
else
{
echo "yingwen ";
}
Author "Technical Life"
http://www.bkjia.com/PHPjc/478636.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478636.htmlTechArticle$str = China; if (preg_match(/^[x7f-xff]+$/, $str)) { //Compatible with gb2312, utf-8 echo zhongwen; } else { echo yingwen ; } The author's technical life...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn