PHP json_decode() Function is used to decode JSON array or a JSON object into a PHP object or an associative array. A json_decode() function is built-in function in PHP.
Syntax :
json_decode(json $jsondata,$flag = false);
Parameter,
$array: Required. It is a input jsondata.
$flag : Optional. Default value is false. If It set to true, JSON objects are decoded into associative arrays. If It set to false, JSON objects are decoded into php objects.
Return Values :
It returns a PHP object or associative array for JSON Data.
JSON Data can be decoded into php object by using the PHP function json_decode().
Let's see below example to understand php json_decode() Function in details.
Comments