unpack
Unpack data from binary string
&reftitle.description;
arrayunpack
stringformat
stringdata
Unpacks from a binary string into an array according to the given
format.
unpack works slightly different from Perl as
the unpacked data is stored in an associative array. To
accomplish this you have to name the different format codes and
separate them by a slash /.
&reftitle.parameters;
format
See pack for an explanation of the format codes.
data
The packed data.
&reftitle.returnvalues;
Returns an associative array containing unpacked elements of binary
string.
&reftitle.examples;
unpack example
]]>
The resulting array will contain the entries "chars1",
"chars2" and "int".
&reftitle.notes;
Note that PHP internally stores integral values as signed. If you
unpack a large unsigned long and it is of the same size as PHP
internally stored values the result will be a negative number
even though unsigned unpacking was specified.
&reftitle.seealso;
pack