Menu Samaritan's Purse

UNPACK

Unpack data from binary string

SYNTAX

unpack ( string $format , string $data [, int $offset = 0 ] ) : array

PARAMETERS

format

See pack() for an explanation of the format codes.

data

The packed data.

offset

The offset to begin unpacking from.

RETURN

Returns an associative array containing unpacked elements of binary string.

EXAMPLES

1

Array
(
    [chars] => 4
    [int] => 160
)

2

Array
(
    [chars1] => 4
    [chars2] => 0
    [int] => 40960
)

PHP