Home >Backend Development >PHP Tutorial > php gbk编码5c有关问题
php gbk编码5c问题
<?php $a = "哲"; $len = strlen("$a"); for($i=0;$i<$len;$i++){ printf("%0x",ord($a[$i])); echo "\n"; } printf("%0x",ord("\\")); echo "\n"; echo chr(hexdec("d5")).chr(hexdec("5c")); echo "\n"; ?>
?如果单纯写echo "闸;则出现语法错误。PHP Parse error: syntax error, unexpected end of file in /home/keke/1.php on line 5
原因通过以上代码就可以明白了。