Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用PHP动态创建内容的JSON mime类型_Php_Json_Dynamic - Fatal编程技术网

使用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')