Your way is to use json_encode function:
return json_encode(array('JSChart' => array(
'datasets' => array(
...
),
));
More Related Contents:
- nested json using php and mysql
- How to convert the json image url string into Bitmap image to display images in android application
- JSON encode MySQL results
- PHP MySQL Google Chart JSON – Complete Example [closed]
- The holy grail of cleaning input and output in php?
- org.json.JSONException: Value
- Send data from android to server via JSON
- Sending HTML Code Through JSON
- What is the type this string? a:1:{s:2:”en”;}
- How to build a JSON array from mysql database
- UTF-8 character encoding battles json_encode() [duplicate]
- How to insert json array into mysql database
- how to fetch all the row of the result in php mysql?
- The ultimate emoji encoding scheme
- How to remove array index from json object while convert array to jsonobject php? [closed]
- Selecting events between dates in mysql
- Thank you for helping [closed]
- How can create Database using url or other method [duplicate]
- LIMIT keyword on MySQL with prepared statement [duplicate]
- How to call a MySQL stored procedure from within PHP code?
- Converting MySQL result array to JSON [duplicate]
- How to setup ElasticSearch index structure with multiple entity bindings
- PHP json encode – Malformed UTF-8 characters, possibly incorrectly encoded [duplicate]
- Get Updated Value in MySQL instead of affected rows
- How Can I Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations?
- Can I blindly replace all mysql_ functions with mysqli_?
- Warning: mysqli_query() expects parameter 1 to be mysqli, resource given [duplicate]
- Storing datetime as UTC in PHP/MySQL
- How do you make good use of multicore CPUs in your PHP/MySQL applications? [closed]
- How to get a list of databases?