Help for this page

Select Code to Download


  1. or download this
    When unpacking, A strips trailing whitespace and nulls,
    Z strips everything from the first null to the end,
    and a returns data with no stripping at all.
    
  2. or download this
    $b = pack("Z*C", "test", 10)
    ($str, $byte) = unpack("Z*C", $b);
    
  3. or download this
    When unpacking, a grabs everything and returns unchanged,
    A grabs everything but strips from first null to the end
    and trailing spaces.
    Z stops after first null, the null is stripped from data.