$str = 'ssssss';
$arr = json_decode($str, TRUE);
var_dump($arr); // NULL
mixed json_decode ( string $json
[, bool $assoc
= false [, int $depth
= 512 [, int$options
= 0 ]]] )
Return Values ¶
Returns the value encoded in json
in appropriate PHP type. Values true, false and null are returned as TRUE
, FALSE
and NULL
respectively. NULL
is returned if the json
cannot be decoded or if the encoded data is deeper than the recursion limit.