DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
PHP Headers To Serve JSON
The first two headers prevent the browser from caching the response (a problem with IE and GET requests) and the third sets the correct MIME type for JSON.
header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-type: application/json');