php 中使用 header() 设置json格式的文档类型是见到过下面的几种方式。
application/json
application/x-javascript
text/javascript
text/x-javascript
text/x-json
text/json
application/json是更通用且符合标准的
php中应该这样设置
header('Content-type: application/json');
注意在使用jsonp时要使用application/javascript文档类型
参考资料
JSON数据的HTTP Header应该怎么标记?
http://segmentfault.com/q/1010000000166541
http://www.ietf.org/rfc/rfc4627.txt
http://stackoverflow.com/questions/477816/what-is-the-correct-json-content-type