serialize- produces a representation of a value that can be stored
string serialize ( mixed
$value
)
Serialize () returns a string that contains the value
byte stream represented and can be stored anywhere.
This facilitates the storage or delivery of PHP values without losing their type and structure.
To change the serialized string back to PHP's value, use unserialize (). serialize () can handle any type except resource. You can even serialize () those arrays that contain pointers to their own references. The references in the array/object you are serialize () will also be stored.
When serializing an object, PHP will attempt to call the object's member function __sleep () before the sequence action . This allows the object to do any cleanup before it is serialized. Similarly, when you use unserialize () to restore an object, the __wakeup () member function is called.
Note:
In PHP 3, the object properties will be serialized, but the method will be lost. PHP 4 Breaks This limit and can store properties and methods at the same time. See the serialization Objects section of classes and objects for more information.
PHP Serialize ()