I have a series of Hex values like 0x1b12, 0x241B, 0x2E24, 0x392E and I need to calculate the Lower byte and Upper Byte from each of these hex values for further processing. How can I do that? I did a bit of research and saw that there is an unpack function in php but the "format" part in the argument is making me confused. Some of the unpack code that I've seen is added below.
unpack("C*",$data)
unpack("C*myint",$data)
unpack("c2chars/n2int",$data)
As mentioned the aforementioned code, I don't quite understand what "C*","C*myint","c2chars/n2int" does in the unpack function. So I'm not quite sure if I can use unpack as the solution to my problem. Your help is much appreciated.
Thanks in advance.