title: Check file_get_contents
body: <p>If I open an external file like this:</p>
  
  <pre><code>$source = @file_get_contents('http://somewebsite.com/todaysinfo/');
  $decode = json_decode($source, true);
  </code></pre>
  
  <p>How should I check if the http call was successful or not (page down or other)?</p>
  
  <pre><code>if ($source) { // will this re-load the page and check for TRUE return?
  
     // success
  
  }
  </code></pre>
  
  <p>or could/should I do it like this (setting and checking the source at once)</p>
  
  <pre><code>if ($source = @file_get_contents('http://somewebsite.com/todaysinfo/')) {
  
     // success
     $decode = json_decode($source, true);
  
  }
  </code></pre>