if you want to check when this function fails,make sure to compare the return value with === instead of == :
<?php
$url = 'http://www.example.com';
$xml = simpleXML_load_file($url,"SimpleXMLElement",LIBXML_NOCDATA);
if($xml === FALSE)
{
//deal with error
}
else { //do stuff }
?>
Otherwise you may end up with FALSE all the time even if the document is ok. Hope this helps someone ;)