Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果我这样做echo(0xbf5c);,它会呈现0xbf5c。但它通常对应一个中文字母。我怎样才能使后者显示?
echo(0xbf5c);
0xbf5c
谢谢
将字符拆分为单个字节,并在双引号字符串中使用 PHP 的 \xhh(具有十六进制代码 hh 的字符)转义字符:
header("Content-Type: text/plain; charset=GBK"); echo "\xbf\x5c";
header如果您的网络服务器已配置为使用 GBK 字符集,则不需要该行。
header