Save XML from url to file

set_time_limit(0); $fp = fopen ('./products.xml', 'w+'); $ch = curl_init('http://siteurl......');// or any url you can pass which gives you the xml curl_setopt($ch, CURLOPT_TIMEOUT, 50); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_exec($ch); curl_close($ch); fclose($fp);