Unpacking Values from Binary Data Using unpack() : unpack « Data Structure « PHP






Unpacking Values from Binary Data Using unpack()

 
<?php
     $bdata = unpack("nint1/nint2", $data);
     echo "The first integer in the packed data: {$bdata['int1']}<BR>";
     echo "The second integer in the packed data: {$bdata['int2']}<BR>";
?>
  
  








Related examples in the same category

1.Parsing fixed-width records with unpack()