This might be an easy fix.
I need to break an 8 bit binary number into 8 separate variables. When using unpack(), it pushes the first zeros it finds to the back as NULLs
0111 1111 gets translated at 1111 111 null
$binary3 = 01111111;
list($b7, $b6, $b5, $b4, $b3, $b2, $b1, $b0) = array_values(unpack('c*', $binary3));
var_dump($b7, $b6, $b5, $b4, $b3, $b2, $b1, $b0);
My OUTPUT
-----HIBYTE------
7f HEX
01111111
-----LOBYTE------
7f HEX
01111111
-----DATABYTE------
7f HEX
01111111
---------------
int(49) int(49) int(49) int(49) int(49) int(49) int(49) NULL
int(49) int(49) int(49) int(49) int(49) int(49) int(49) NULL
int(49) int(49) int(49) int(49) int(49) int(49) int(49) NULL
Bit 0 is
Bit 1 is 49
Bit 2 is 49
Bit 3 is 49
Bit 4 is 49
Bit 5 is 49
Bit 6 is 49
Bit 7 is 49