1 2 3 |
header('Cache-Control: no-cache, must-revalidate');<br>header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');<br>header('Content-type: application/json'); |
The first two headers prevent the browser from caching the response and the third sets the correct MIME type for JSON.
Than just output your JSON data
1 2 3 4 5 6 7 8 9 10 11 12 |
$data = array( "fire" => 1, "water" => 0, "earth" => 1, "air" => 1, ); echo json_encode($data); exit; |