Php checks whether the string is full of Chinese characters or the implementation code that contains Chinese characters. it mainly uses regular expressions to match Chinese characters. Php implementation code _ php skills 
 
I. All judgments are in Chinese.
 
The code is as follows:
 
$ Str = "'2014 Is"; if (! Eregi ("[^ \ x80-\ xff]", "$ str") {echo "all Chinese";} else {echo "not ";} 
2. identify Chinese characters
 
The code is as follows:
 
$ Str = "Chinese"; if (preg_match ("/[\ x7f-\ xff]/", $ str) {echo "contains Chinese ";} else {echo "no Chinese ";} 
Or
 
$ Pattern = '/[^ \ x00-\ x80]/'; if (preg_match ($ pattern, $ str) {echo "contains Chinese ";} else {echo "no Chinese ";} 
I have tested these methods under UTF-8, but I have not tested other encodings.
 
The above is the php content to determine whether the string is full of Chinese characters or the implementation code _ php skills that contain Chinese characters. For more information, see PHP Chinese website (www.php1.cn )!