保存并读取从其他URL获取的xml文件

may be i am going to ask some stupid question but i don't have any idea about php that's why i want to know it i never worked in php and now i have to do it so please provide me some useful tips, i have XML file that is coming from a different URL and i want to save it on the server then i have to read it and extract it to a page in proper format and some modification in data.

You can use DOM

$dom = new DOMDocument();
$dom->load('http://www.example.com');

This would load the XML from the remote URL. You can then process it as needed. See my previous answers on various topics using DOM. To save the file to your server after your processed it, you use

$dom->save('filename.xml');

Loading the file with $dom->load() will only work if you have allow_url_fopen enabled in your php.ini. If not, you have to use cURL to download the remote file first.

Maybe this should be helpfull to you: http://www.php.net/manual/en/function.simplexml-load-file.php

If you're have dificulte to get the XML file from the remote host you can use combine with above simplexml-load-string

$path_to_xml = 'http://some.com/file.xml';
$xml = simplexml_load_string( file_get_content($path_to_xml) );