How to unpack a binary string in PHP?
1 answer
Since pack / unpack in PHP does not support type B, you will have to use other PHP functions. In this case, dechex
and bindec
.
echo dechex( bindec( "00000000100000012000000" ));
Edit: Or do it in one function with base_convert:
echo base_convert("00000000100000012000000", 2, 16);
+4
a source to share