How to unpack() the first structure in this list?
I want the second field as integer (or to say better as float since PHP doesn't support 64bit int)
How to unpack() the first structure in this list?
I want the second field as integer (or to say better as float since PHP doesn't support 64bit int)
Thanks to mario, I solved it like this:
$a = unpack("i", $this->read(4));
$b = unpack("i", $this->read(4));
$packet['file_length'] = $a[1] + $b[1] * 0x100000000;
Where $this->read()
is a wrapper for:
mb_substr($data, $offset, $length, '8bit');