$jsonArray = json_encode(array);
Out of the box (but of course before that you should alter your array to be an associative one) 🙂
More Related Contents:
- PHP generate json – list of categories [closed]
- Getting particular object
- Json array to json php
- Returning JSON from a PHP Script
- Reference: Why are my “special” Unicode characters encoded weird using json_encode?
- Simple jQuery, PHP and JSONP example?
- How to create an array for JSON using PHP?
- Why would json_encode return an empty string
- json_encode() escaping forward slashes
- Fastest way to check if a string is JSON in PHP?
- Get JSON object from URL
- How to convert mysqli result to JSON? [duplicate]
- Send JSON data from Javascript to PHP?
- ByetHost server passing html values “Checking your browser” with JSON String
- Is there any way to convert json to xml in PHP?
- PHP date format /Date(1365004652303-0500)/
- Converting Object to JSON and JSON to Object in PHP, (library like Gson for Java)
- Get a PHP object property that is a number [duplicate]
- Submitting JSON data via JQuery ajax.post to PHP
- how to decode this JSON string?
- Adding subscribers to a list using Mailchimp’s API v3
- jQuery $.ajax request of dataType json will not retrieve data from PHP script
- json_encode() non utf-8 strings?
- How to pass an array using PHP & Ajax to Javascript?
- Accessing JSON array after json_decode/multidimensional array
- Find JSON strings in a string
- PHP json_encode json_decode UTF-8
- PHP: How to encode infinity or NaN numbers to JSON?
- Writing JSON object to .json file on server
- PHP JSON encode output number as string