convert a json string to array php code example
Example 1: php json_decode
$personJSON = '{"name":"Johny Carson","title":"CTO"}';
$person = json_decode($personJSON);
echo $person->name; // Johny Carson
Example 2: php json encode
$person = array(
"name" => "Johny Carson",
"title" => "CTO"
);
$personJSON=json_encode($person);//returns JSON string