PHP强制下载json [英] PHP force download json
本文介绍了PHP强制下载json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
强制使用PHP下载文件
如果我在一个变量中有一个json,我该如何强制下载? (该文件不存在)
If I have a json in a variable, how can I force the download? (The file not exist).
谢谢。
推荐答案
header('Content-disposition: attachment; filename=file.json');
header('Content-type: application/json');
echo $json;
这篇关于PHP强制下载json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文