← All built-ins / unserialize()
unserialize()
unserialize(mixed $number): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $s | string | string from serialize() |
Return value
The restored value. Never unserialize untrusted input.
Example
$a = [1, "k" => true]; $b = unserialize(serialize($a)); echo $b["k"] ? "roundtrip-ok" : "bad";
roundtrip-ok