PHP pack() Function
Definition and Usage
The pack() function packs data into a binary string.
Syntax
pack(format,args+)
Parameter Values
| Parameter | Description |
|---|---|
| format | Required. Specifies the format to use when packing data. Possible values:
|
| args+ | Optional. Specifies one or more arguments to be packed |
Technical Details
| Return Value: | Returns data in a binary string |
|---|---|
| PHP Version: | 4+ |
| Changelog: | PHP 7.2 - float and double now supports both big and small endian. PHP 7.0.15 - The "E", "e", "G", "g" code was added. PHP 5.6.3 - The "Q", "q", "J", "P" code was added. PHP 5.5 - The "Z" code was added (holds the same functionality as "a" for Perl compatibility). |
More Examples
❮ PHP Misc Reference