json_decode:- It is used for decoding JSON in PHP. This function returns the value decoded from json to appropriate PHP type.

mixed json_decode ( string $json [, bool $assoc = false [, int $depth = 512 [, int $options = 0 ]]] )

(i) json :- The json string being decoded. This function only works with UTF-8 encoded data.
(ii) assoc:- When TRUE, returned objects will be converted into associative arrays.
(iii) depth:- User specified recursion depth.
(iv) options:- Bitmask of JSON decode options. Currently only JSON_BIGINT_AS_STRING is supported (default is to cast large integers as floats).

$jsonData = ‘{ "user":"John", "age":26, "country":"India" }’;
$phpArray = json_decode($jsonData);
foreach ($phpArray as $key => $value) {
echo $key .’|’. $value";
Output:- stdClass Object ( [user] => John [age] => 26 [country] => India )
Output:- user | John
Output:- age | 26
Output:- country | India