title: Get http-statuscode without body using cURL?
body: <p>I want to parse a lot of URLs to only get their status codes.</p>
  
  <p>So what I did is:</p>
  
  <pre><code>$handle = curl_init($url -&gt; loc);
               curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
               curl_setopt($handle, CURLOPT_HEADER  , true);  // we want headers
               curl_setopt($handle, CURLOPT_NOBODY  , true);
               curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
               $response = curl_exec($handle);
               $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE);
               curl_close($handle);
  </code></pre>
  
  <p>But as soon as the "nobody"-option is set to true, the returned status codes are incorrect (google.com returns 302, other sites return 303).</p>
  
  <p>Setting this option to false is not possible because of the performance loss.</p>
  
  <p>Any ideas?</p>