so I grab some information from an XML file, for example:
$url = "http://myurl.blah"; $xml = simplexml_load_file($url);
Unless the XML file is empty and I need the code to fail, but I cannot figure out how to catch the PHP error. I tried this:
if(isset(simplexml_load_file($url))); { $xml = simplexml_load_file($url); } else { echo "No info avilable."; }
But that will not work. I think you cannot use ISSET in this way. Does anyone know how to catch a bug?
source share