Home > Backend Development > PHP Tutorial > php gbk编码5c有关问题

php gbk编码5c有关问题

WBOY
Release: 2016-06-13 13:01:48
Original
912 people have browsed it

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";
?>
Copy after login
Copy after login
Copy after login
Copy after login
Copy after login

?如果单纯写echo "闸;则出现语法错误。PHP Parse error: syntax error, unexpected end of file in /home/keke/1.php on line 5

原因通过以上代码就可以明白了。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template