<?php header('Content-Type: application/json'); echo json_encode(array('a' => 123, 'b' => 456));
info at phpclasses dot org