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? Tha
check the curl_error after the curl_getinfo to find out the hidden errors.
if(curl_errno($ch)){ echo 'Curl error: ' . curl_error($ch); }