php parse array to json string code example
Example 1: php convert array to json object
$myArr = array("apple", "banana", "mango", "jackfruit");
$toJSON = json_encode($myArr);
echo $toJSON;
Example 2: php json_decode
$personJSON = '{"name":"Johny Carson","title":"CTO"}';
$person = json_decode($personJSON);
echo $person->name; // Johny Carson