Ish*_*Ish 46
<?php
header('Content-type: text/xml');
header('Content-Disposition: attachment; filename="text.xml"');
echo $xml_contents;
Run Code Online (Sandbox Code Playgroud)
Vla*_*ado 12
如果您使用某种输出缓冲作为框架的一部分,则必须在XML输出下面添加exit(),如下所示:
<?php
header('Content-type: text/xml');
header('Content-Disposition: attachment; filename="text.xml"');
echo $xml_contents;
exit();
Run Code Online (Sandbox Code Playgroud)
否则,您将获得整个缓冲页面,而不仅仅是XML输出.
| 归档时间: |
|
| 查看次数: |
33060 次 |
| 最近记录: |