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.
我有一个从 bin2hex() 调用中获得的十六进制数字。我需要一个以下面概述的格式表示此数字的字符串:
$tmp = bin2hex($foo) // $tmp is 0x123efd
我需要一些代码来给我字符串"123efd"。
它是十六进制 (0x) 的前缀。您需要删除前缀
$tmp = substr(bin2hex($foo), 2); // $tmp is 123efd //assume that prefix is only 2 digits and you always remove the 2 digits