(PHP 4, PHP 5, PHP 7)
serialize — Generates a storable representation of a value
string serialize ( mixed
Generates a storable representation of a value.
This is useful for storing or passing PHP values around without losing their type and structure.
To make the serialized string into a PHP value again, use unserialize().
Returns a string containing a byte-stream representation of
Note that this is a binary string which may include null bytes, and needs to be stored and handled as such. For example, serialize() output should generally be stored in a BLOB field in a database, rather than a CHAR or TEXT field.
Example #1 serialize() example
When serialize() serializes objects, the leading backslash is not included in the class name of namespaced classes for maximum compatibility.