- 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.
- or download this
$b = pack("Z*C", "test", 10)
($str, $byte) = unpack("Z*C", $b);
- 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.