How to create this type of JSON data from PHP [closed]

Your way is to use json_encode function:

return json_encode(array('JSChart' => array(
    'datasets' => array(
        ...
    ),
));

Leave a Comment