json.php
$document = JFactory::getDocument();
// Set the MIME type for JSON output.
$document->setMimeEncoding('application/json');
// Output the JSON data.
echo json_encode($data);
More than 5 years have passed since last update.
$document = JFactory::getDocument();
// Set the MIME type for JSON output.
$document->setMimeEncoding('application/json');
// Output the JSON data.
echo json_encode($data);
Register as a new user and use Qiita more conveniently