<p>I wrote a PHP code like this</p>

<pre><code>$site="http://www.google.com";
$content = file_get_content($site);
echo $content;
</code></pre>

<p>But when I remove "http://" from <code>$site</code> I get the following warning:</p>

<blockquote>
  <p>Warning:
  file_get_contents(www.google.com)
  [function.file-get-contents]: failed
  to open stream:</p>
</blockquote>

<p>I tried <code>try</code> and <code>catch</code> but it didn't work.</p>

You can prepend an @:
```
$content = @file_get_contents($site);
```
This will supress any warning -
use sparingly!
. See
Error Control Operators
Edit: When you remove the 'http://' you're no longer looking for a web page, but a file on your disk called "www.google....."