September 2001
Intermediate to advanced
768 pages
32h 45m
English
mixed pack(string format, mixed args, [mixed args])
| format | Format to use to pack the data |
| args | Piece of data to be packed into the string |
| args | Zero or more additional arguments to be packed into the string |
Creates a binary string from a list of values.
Returns:
Binary string; FALSE on error
Description:
pack() transforms a list of values into a sequence of bits based on a user-defined format. It’s a powerful tool that allows developers to work directly with binary data. pack() can be used for many purposes—from simple tasks such as trimming and padding strings to more complex tasks such as altering binary files.
Calls to the function look like this:
$binary_string = pack ('C4', 128, 9, 176, 32); The first argument contains the format ...
Read now
Unlock full access