Shaun Posted November 3, 2008 Share Posted November 3, 2008 instead of $xml = simplexml_load_file($url) or die('Cannot retrieve feed'); could I do $xml = simplexml_load_file($url) or $xml = 0; ?? the reason I ask, is because my server sometimes plays up, and wont resolve names.. and instead of returning the error, or dieing.. I want to just return $xml as another value to check against in another script. Link to comment https://forums.phpfreaks.com/topic/131265-solved-very-quick-and-simple-question/ Share on other sites More sharing options...
Prismatic Posted November 3, 2008 Share Posted November 3, 2008 simplexml_load_file() returns false when a file cannot be loaded, so you can simply remove the or xxx part and check $xml for false Link to comment https://forums.phpfreaks.com/topic/131265-solved-very-quick-and-simple-question/#findComment-681568 Share on other sites More sharing options...
Shaun Posted November 3, 2008 Author Share Posted November 3, 2008 ah right ok, thanks Link to comment https://forums.phpfreaks.com/topic/131265-solved-very-quick-and-simple-question/#findComment-681580 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.