I'm trying to get only the three digit http status code number and nothing more in the variable $response. For example 302, 404, 301, and what not. Another observation I noticed with my code is on some websites such as google it's downloading what appears to be part of the body, which is a huge waste of bandwidth and slow.
<?php
$URL = 'http://www.google.com';
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $URL);
curl_setopt($curlHandle, CURLOPT_HEADER, true);
$response = curl_exec($curlHandle);
echo $response;
?>