safe_unserialize()
public static function safe_unserialize( $string, $expected, $default=false )
Unserializes a string while suppressing errors, checks if the result is of the expected type.
Since: 2.6.2.1
Source: common.php:8008
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$string | string | The string to be unserialized. | |
$expected | string | The expected type after unserialization. | |
$default | bool | false | The default value to return if unserialization failed. |
Returns
false|mixed