I have a 1024 bit long binary stream of data which I'd like to convert to an array of 32-bit integers (e.i. 32 numbers). From this question I used this code:
$filename = "myFile.sav";
$handle = fopen($filename, "rb");
$fsize = filesize($filename);
$contents = fread($handle, $fsize);
$byteArray = unpack("N*",$contents);
print_r($byteArray);
And even though it formats itself as "N", var_dump then prints out an array of 256 8-bit long integers. (I want 32 32-bit long numbers). What am I doing wrong?
EDIT: its not actually 256 8-bit numbers, but 256 gibberish values