Can I create a new XML file that copies and auto updates an existing XML?
I have found开发者_Python百科 a XML file through google search that will help me for a simple project I am doing. The problem is that I do not want to fetch the file but to create a new one on my server that copies and auto updates from the other. I tried to save it to my hard disc but it does not update.
I know that there is a way to do it because I have seen it but I don't have any clue how. I guess they created a "createxml.php" file that does what it does...
Any ideas or examples? Thank you!
So you want to pull in a remote XML file, do something with it and then save it on your hard drive?
In that case use simpleXML
$xml = simplexml_load_file('http://url.com/file.xml');
// Do something
file_put_contents('c:\file.xml', $xml->asXML());
If you want this script to run regularly then run it from a cron job.
Is this what you are after?
精彩评论