开发者

How to download xml file through in php?

开发者 https://www.devze.com 2023-02-13 22:48 出处:网络
I created xml file in php.This file is successfully saved in my server direct开发者_如何转开发ory.

I created xml file in php. This file is successfully saved in my server direct开发者_如何转开发ory.

Now, I want to download this file only through php, not javascript.

How can I save this file?


Try file_get_contents() and 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.

?>
0

精彩评论

暂无评论...
验证码 换一张
取 消