title: How can I handle the warning of file_get_contents() function in PHP?
body: <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>