(PHP 4, PHP 5, PHP 7, PHP 8) unserialize — Creates a PHP value from a stored representation Descriptionunserialize(string unserialize() takes a single serialized variable and converts it back into a PHP value. Warning Do not pass untrusted user input to unserialize() regardless of the If you need to unserialize externally-stored serialized data, consider using hash_hmac() for data validation. Make sure data is not modified by anyone but you. Parametersdata The serialized string. If the variable being unserialized is an object, after successfully reconstructing the object PHP will automatically attempt to call the __unserialize() or __wakeup() methods (if one exists).
options Any options to be provided to unserialize(), as an associative array. Valid options
Return ValuesThe converted value is returned, and can be a bool, int, float, string, array or object. In case the passed string is not unserializeable, Errors/ExceptionsObjects may throw Throwables in their unserialization handlers. Changelog
ExamplesExample #1 unserialize() example
Example #2 unserialize_callback_func example
NotesWarning See Also
me+phpnet at unreal4u dot com ¶ 4 years ago
hadley8899 at gmail dot com ¶ 2 years ago
daniel at fourstaples dot com ¶ 12 years ago
ErnestV ¶ 9 years ago
chris at pollett dot org ¶ 7 years ago
Ray.Paseur often uses Gmail ¶ 9 years ago
chris AT cmbuckley DOT co DOT uk ¶ 14 years ago
arbie samong ¶ 13 years ago
$data2->obj2property2 as $key => $value):
m.m.j.kronenburg ¶ 6 years ago
// namespacenamespace my_name_space chris at colourlovers dot com ¶ 11 years ago
is_array($data)) { BenBE at omorphia dot de ¶ 15 years ago
w dot laurencine at teknoa dot net ¶ 13 years ago
double at dumpit dot com ¶ 15 years ago
Are Pedersen ¶ 16 years ago
Chris Hayes (chris at hypersites dot com) ¶ 17 years ago
suman dot jis at gmail dot com ¶ 10 years ago
Anonymous ¶ 3 years ago
aderyn at nowhere dot tld ¶ 18 years ago
MBa ¶ 11 years ago
walf ¶ 11 years ago
Fagzal ¶ 12 years ago
|