First method:
Load the Encode module, provided you need to install this module
Example code:
Copy code The code is as follows:
$str=decode("gb2312",$names[$index]);
@chars=split(//,$str);
foreach(@chars)
{
$char=encode("gb2312",$_);
print "ONE WORD:$charn";
}
The second method: Chinese characters occupy 2 bytes, so you can use the following statement to directly get the Chinese characters. The code is as follows:
@chars=split(//,$ names[$index]);
$str=$chars[0].$chars[1];
http://www.bkjia.com/PHPjc/320260.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320260.htmlTechArticleThe first method: Load the Encode module, provided that you need to install this module. Example code: Copy the code as follows: $str=decode("gb2312",$names[$index]); @chars=split(//,$str)...