making json string while fetching data from table php code example
Example: php access json object
<?php
// JSON string
$someJSON = '[{"name":"Jonathan Suh","gender":"male"},{"name":"William Philbin","gender":"male"},{"name":"Allison McKinnery","gender":"female"}]';
// Convert JSON string to Object
$someObject = json_decode($someJSON);
echo $someObject[0]->name; // Access Object data
?>