PHP JSON response contains HTML headers
问题 I've got a strange problem where I'm trying to write a PHP page that returns some JSON to a Jquery AJAX call. Problems is that despite setting the content type to application/json, the response always seems to include the HTML header. Here's the PHP code: // some code that generates an array header("Content-type: application/json"); echo json_encode($return); Then in Javascript: $.ajax({ url: '/VAPHP/services/datatable.php', dataType: 'json', data: { type: 'invoices' }, success: function(data