Home  >  Article  >  Backend Development  >  PHP Chinese and English judgment_PHP tutorial

PHP Chinese and English judgment_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:45:451151browse

$str = 'China';
if (preg_match("/^[x7f-xff]+$/", $str))
{ //Compatible with gb2312,utf-8
echo "zhongwen";
}
else
{
echo "yingwen ";
}
Author "Technical Life"

www.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