$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_PROXY, $proxy); // $proxy is ip of
You're trying to access a HTTP response code before you actually make the HTTP call. Reverse the execution as follows:
$response = curl_exec($ch); $httpCode = curl_getinfo($ch , CURLINFO_HTTP_CODE); // this results 0 every time