unpack

array unpack(string format, string binary_string) 
format Format to use when unpacking
binary_string Binary string to unpack

Parses a binary string according to a user-defined format.

Returns:

Associative array; FALSE on error

Description:

unpack() is the complement of pack()—it transforms binary data into an associative array based on the format specified.

The format string consists of a format character, optionally followed by an integer. Depending on the format character, the integer either indicates a length or a quantity. The integer should be followed by a string. The string is used as the key for entries in the associative array that are created by the format code. If the format code creates more than one entry in the array, ...

Get PHP Functions Essential Reference now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.