title: Get CURLOPT_URL to echo text if file does not exist
body: <p>I'm using this curl function to load the remote file <code>file.php</code>.</p>
  
  <pre><code>$ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, "http://example.com/file.php");
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
      if(curl_exec($ch) === FALSE) {
           echo 'No file';
      } else {
           echo curl_exec($ch);
      }
  
      curl_close($ch);
  </code></pre>
  
  <p>But if the file does not exist, I get the standard server 404 file at <code>example.com</code>.</p>
  
  <p>How can I get curl to echo the "No file" text?</p>
  
  <p>I've looked at this question <a href="https://stackoverflow.com/questions/408405/easy-way-to-test-a-url-for-404-in-php">Easy way to test a URL for 404 in PHP?</a> but I think a simpler example would be useful.</p>