<分区>
Possible Duplicate:
Forcing to download a file using PHP
如果我在变量中有一个 json,我该如何强制下载? (该文件不存在)。
谢谢。
<分区>
Possible Duplicate:
Forcing to download a file using PHP
如果我在变量中有一个 json,我该如何强制下载? (该文件不存在)。
谢谢。
最佳答案
header('Content-disposition: attachment; filename=file.json');
header('Content-type: application/json');
echo $json;
关于PHP强制下载json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11545661/