Output json to browser

Correct way outputting json with appropriate headers.

php
fork add to bundle source
function output_json( $array ) { header('Content-Type: application/json'); echo json_encode($array); }
create log ...inout