[英]How to download xml file through in php?
我在php中创建了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.
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.