I’m requesting information from a remote server which is sent back to me as XML, I use SimpleXML to parse it. However I need to load multiple URLs, can I do so through one file, or do I need to have a different file for each request?
My code looks something like this
$url = 'http://...';
$xml = simplexml_load_file($url);
Thanks!
You can create a loop that deals with the multiple urls…
$all_urls = array('http://url1', 'http://url2', 'http://url3'); foreach ($all_urls as $url) { $xml = simplexml_load_file($url); }