PHP handle errors
<p>Using this code with simplehtmldom script (<a href="http://simplehtmldom.sourceforge.net/manual.htm" rel="nofollow">http://simplehtmldom.sourceforge.net/manual.htm</a>):</p>

<pre><code>function file_get_html() {
    $dom = new simple_html_dom;
    $args = func_get_args();
    $dom-&gt;load(call_user_func_array('file_get_contents', $args), true);
    return $dom;
}

$url = 'http://site.com/';
$html = file_get_html($url);
</code></pre>

<p>How to handle erros on <code>file_get_html($url)</code> part? Now, if page doesn't exist, it shows errors in browser window. I prefer to catch them and show my text instead, like:</p>

<pre><code>if(some error happened on file_get_html($url)) {
   $errors = true;
} else {
   html = file_get_html($url);
}
</code></pre>

<p>Thanks.</p>
