we can convert JSON string to an array with the help of json decode() function. This functon accepts the JSON string as the first parameter and a few additional parameters to control the process of converting JSON to PHP array.
we use the json decode() function to convert JSON string to an array in php.
example
<?php
$json_string = '{"mp": "gwalior", "bhopal": "delhi", "mumbai": "gujrat"}';
echo "<pre>";
print_r (json_decode($json_string));
echo "</pre>";
?>
output
stdClass Object
(
[mp] => gwalior
[bhopal] => delhi
[mumbai] => gujrat
)