? < 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!