PHP regular string to determine whether all Chinese

? < PHP
 / * * 
 * determined whether all Chinese string 
 * / 
function isAllChinese ( $ STR ) {
     IF ( the preg_match ( '/ ^ [\ x7f- \ xFF] + $ /', $ STR )) {
         return  to true ; // all Chinese 
    } the else {
         return  false ; // not all Chinese 
    } 
} 
 
var_dump (isAllChinese ( 'Hello' ));
 
 ?>

From the micro-channel public number: Programming Society

Advanced programmers daily book, please pay attention!

Guess you like

Origin www.cnblogs.com/ai10999/p/11449485.html