In my application I am loading xml from url in order to parse it. But sometimes this url may not be valid. In this case I need to handle errors. I have the following code:>
To disable throwing errors:
$internal_errors = libxml_use_internal_errors(true); $dom = new DOMDocument(); // etc... libxml_use_internal_errors($internal_errors);