0

Can someone explain why I can load and manipulate the following xml file if it is local, see code.

If I use the simplexml_load_file to get a url like the one below I get an error. The external xml file I'm using is from W3 Schools.

https://www.w3schools.com/xml/cd_catalog.xml

<?php
$xml=simplexml_load_file("cd_catalog.xml") or die("Error: Not Working");
foreach($xml->children() as $cds) {
echo "<p>". $cds->TITLE . "<br>";
echo $cds->ARTIST . "<br>";
echo $cds->YEAR . "</p>";
}
?>

I know this has been discussed but I can't seem to get a definitive answer. Any help would be appreciated.

ultrarun
  • 274
  • 1
  • 13

1 Answers1

0

Network Proxy/Firewall issues going from MAMP local server to outside world, fixed. So the above will work if it helps anybody.

ultrarun
  • 274
  • 1
  • 13