Skip to content

Instantly share code, notes, and snippets.

@sators sators/json.php
Created Apr 24, 2015

What would you like to do?
Output JSON from PHP with proper Content -ype Header
$data = /** whatever you're serializing **/;
header('Content-Type: application/json');
echo json_encode($data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.