Home >Backend Development >PHP Tutorial >PHP utf-8 Chinese interception without garbled characters (string judgment version)
/*E4 B8 AD E5 9B BD 中国 1110 0100 10111000 10101101 1110 0101 1001101110111101 61 a 0011 1101 0xxx xxxx ,1个字节 110xx xxxx , 2个字节 1110 xxxx, 3 1111 0xxxx 4... */<pre name="code" class="php">$str = '中华人aaa民共b和国,c万岁'; function utf8sub($str,$len){ if($len '; if(strlen($heigh)<br><pre class="brush:php;toolbar:false">
The above introduces PHP utf-8 Chinese interception without garbled characters (string judgment version), including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.