我有一个密钥,我需要使用pack()转换为HEX。
$key = "78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878";
$keyBytes = pack('H*',$key);
但是pack()会返回:
p�������
我需要这个:
[0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38, 0x37, 0x38]
我做错了什么?我完全按照我所掌握的手册进行操作。