You can return json in PHP this way:
header('Content-Type: application/json');
echo json_encode(array('foo' => 'bar'));
exit;
More Related Contents:
- PHP display div with select option
- Simple jQuery, PHP and JSONP example?
- Sending JSON to PHP using ajax
- jQuery ajax request with json response, how to?
- Submitting JSON data via JQuery ajax.post to PHP
- Retrieve JSON POST data in CodeIgniter
- jQuery $.ajax request of dataType json will not retrieve data from PHP script
- Sending HTML Code Through JSON
- How to pass an array using PHP & Ajax to Javascript?
- Removing array index reference when using json_encode()
- Ajax call with contentType: ‘application/json’ not working
- Jquery AJAX post to PHP
- json_encode not working with a html string as value
- PHP JSON encode output number as string
- How and where to put Jquery into a fully PHP page?
- How to insert database rows if there are no answers
- Getting particular object
- How can I parse a JSON file with PHP? [duplicate]
- How to POST JSON Data With PHP cURL?
- Cannot use object of type stdClass as array?
- jQuery UI Sortable, then write order into a database
- ByetHost server passing html values “Checking your browser” with JSON String
- Update fee dynamically based on radio buttons in Woocommerce checkout
- Is there any way to convert json to xml in PHP?
- Get a PHP object property that is a number [duplicate]
- Adding subscribers to a list using Mailchimp’s API v3
- Find JSON strings in a string
- IE10/11 Ajax XHR error – SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3
- How to get exact browser name and version?
- How to Load Ajax in WordPress