Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // outputs json
- header('Content-Disposition: attachment; filename=output.json');
- header('Content-Type: application/json');
- echo json_encode($output);
- // output json
- header('Content-Disposition: attachment; filename=output.js');
- header('Content-Type: text/javascript');
- $json = json_encode($output);
- // it's dirty
- $json = 'var myObject = ' . $json . ';';
- echo $json
Add Comment
Please, Sign In to add comment