我想在PHP中将ASCII转换为十六进制,但是得到的结果与一些在线工具不同。虽然我知道自己需要的结果,但是这个在线工具的结果看起来是正确的,我的代码却不正确,但我无法弄清原因。
String: 2Ffbj?DoyXOU
Correct output: 32 46 66 62 6a 3f 44 6f 79 58 4f 55 (from linked site above)
My output: 32 46 66 62 6a 3f 44 6f 79 58 4f 75
我的脚本:
echo bin2hex(utf8_decode("2Ffbj?DoyXOU"));
故障出在哪里?
bin2hex()
却不能返回正确的结果。 - Gottlieb Notschnabel