Jump to content

SimpleXMLElement: Avoid Fatal Error


thdim

Recommended Posts

Hello Everybody,

 

In my code I use the SimpleXMLElement object to handle some RSS files like this:

$xml = new SimpleXMLElement($feedurl, NULL, true);

 

and it works perfect BUT when there is any problem with the $feedurl (like url change) the SimpleXMLElement crashes with a Fatal Error and that destroys my application flow. Is there any way to avoid SimpleXMLElement crashing? any ideas?

 

p.s. I've tried using  $xml = @new SimpleXMLElement($feedurl, NULL, true); but without success.

 

thanks,

Link to comment
https://forums.phpfreaks.com/topic/98069-simplexmlelement-avoid-fatal-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.