Output JSON in PHP Pavel Fedoruk, 13 October 2022 at 04:08 PM
PHP
<?php
$data = /** whatever you're serializing **/;
header('Content-Type: application/json; charset=utf-8');
echo json_encode($data);

Other recipes

In case you haven't read them yet