Make a php page to output json
by Prakash[ Edit ] 2013-08-03 14:56:59
To make a php to output json you have to send the json header as follows. It will be helpful for ajax json responses :
header('Content-type:application/json');
$data = array('fruit' => 'apple','flower' => 'rose');
echo json_encode($data);
?>