: This article mainly introduces PHP to determine whether the string contains Chinese characters. if you are interested in the PHP Tutorial, refer to it. Refer: http://www.wilf.cn/post/php-match-chinese-str.html
Since the black hat SEO, SPAM has always been one of the work content of website staff. We are not banned from spam message sending machines or spam user registration machines.
Determining whether a string contains Chinese characters is one of the ways to deal with SPAM. it can effectively block SPAM messages in English only and regulate user registration. The following code is compatible with gb2312 and UTF-8.
Additional, double byte character encoding range
1. GBK (GB2312/GB18030)
\ X00-\ xff GBK dubyte encoding range
\ X20-\ x7f ASCII
\ Xa1-\ xff Chinese gb2312
\ X80-\ xff Chinese gbk
2. UTF-8 (Unicode)
\ U4e00-\ u9fa5 (Chinese)
\ X3130-\ x318F (Korean
\ XAC00-\ xD7A3 (Korean)
\ U0800-\ u4e00 (Japanese )*/
The above introduces PHP to determine whether the string contains Chinese characters, including content, and hope to be helpful to friends who are interested in PHP tutorials.