【发布时间】:2017-12-08 18:42:57
【问题描述】:
我在 php.ini 中创建了 xml 文件。此文件已成功保存在我的服务器目录中。
现在,我只想通过 php 下载这个文件,而不是 javascript。
如何保存此文件?
【问题讨论】:
-
你应该接受你最近的问题。
我在 php.ini 中创建了 xml 文件。此文件已成功保存在我的服务器目录中。
现在,我只想通过 php 下载这个文件,而不是 javascript。
如何保存此文件?
【问题讨论】:
试试file_get_contents() 和file_put_contents()。
<?PHP
$xml = file_get_contents("http://yoursite.com/yourxml.xml"); // your file is in the string "$xml" now.
file_put_contents("/path/to/file/yourxml.xml", $xml); // now your xml file is saved.
?>
【讨论】: