Warnings when file_get_content wrong url
<p>I have this code:</p>

<pre><code>&lt;?php
$url = "http://asdsfsfsfsfsdfad.com";
$file = file_get_contents($url);

if(preg_match("/&lt;title&gt;(.+)&lt;\/title&gt;/i",$file,$m))
    print "$m[1]";
else
    print "The page doesn't have a title tag";
?&gt;
</code></pre>

<p>It works fine when the url is a proper url, but when I put in nonsense then I get two warning messages:</p>

<pre><code>Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Navn eller tjeneste ukendt in /var/www/web17/web/administration/custom_pages.php(71) : eval()'d code on line 4
Warning: file_get_contents(http://asdsfsfsfsfsdfad.com) [function.file-get-contents]: failed to open stream: php_network_getaddresses: getaddrinfo failed: Navn eller tjeneste ukendt in /var/www/web17/web/administration/custom_pages.php(71) : eval()'d code on line 4
</code></pre>

<p>Any way to prevent this?</p>
