title: PHP cURL HTTP CODE return 0
body: <p>I dont understand when I echo $httpCode I always get 0, I was expecting 404 when I change $html_brand into a broken url. Is there anything that I miss or do not know of? Thanks.</p>
  
  <pre><code> //check if url exist
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $html_brand);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  $response = curl_exec($ch); 
  $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  
  if ($httpCode == 404) {
      echo "The Web Page Cannot Be Found";
      return;
  }
  curl_close($ch);
  </code></pre>