PHP Manual
unserialize
Description
mixed unserialize ( string str )unserialize() takes a single serialized variable and converts it back into a PHP value.
Parameters
strThe serialized string.
If the variable being unserialized is an object, after successfully reconstructing the object PHP will automatically attempt to call the __wakeup() member function (if it exists).
unserialize_callback_func directive: It's possible to set a callback-function which will be called, if an undefined class should be instantiated during unserializing. (to prevent getting an incomplete object "__PHP_Incomplete_Class".) Use your php.ini, ini_set() or .htaccess to define 'unserialize_callback_func'. Everytime an undefined class should be instantiated, it'll be called. To disable this feature just empty this setting.
Return Values
The converted value is returned, and can be a boolean, integer, float, string, array or object.
In case the passed string is not unserializeable, FALSE is returned and E_NOTICE is issued.
ChangeLog
| Version | Description |
|---|---|
| 4.2.0 | The directive unserialize_callback_func directive became available. |
| 4.0.0 | When serializing an object, methods are not lost anymore. Please see the Serializing Objects for more information. |
Examples
Example 2. unserialize_callback_func example
|
Support PHPRO.ORG
Search
PHPRO.ORG Poll
Warning: Participation in PHPRO.ORG polls may incorrectly lead you to believe your opinions matter.

RSS Feed




