使用PHP动态创建内容的JSON mime类型
可能重复:使用PHP动态创建内容的JSON mime类型,php,json,dynamic,Php,Json,Dynamic,可能重复: 我使用以下行设置了php文件的标题: header('Content-Type', 'application/json'); 服务器出现故障,并显示错误消息: "Tue Oct 23 16:20:09 2012] [error] [client 111.111.111.111] malformed header from script. Bad header=Content-Type: xyz.php, referer:...." 我在网上按照一些建议将其添加到.htacces
我使用以下行设置了php文件的标题:
header('Content-Type', 'application/json');
服务器出现故障,并显示错误消息:
"Tue Oct 23 16:20:09 2012] [error] [client 111.111.111.111] malformed header from script. Bad header=Content-Type: xyz.php, referer:...."
我在网上按照一些建议将其添加到.htaccess文件中
AddType application/json .json
两者都不起作用。如果有任何进一步的帮助,我将不胜感激。请注意
标题()中的引号。
header('Content-type: application/json');
header('Content-type:application/json')代码>