簡體   English   中英

如何通過php下載xml文件?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM