public static function getHttpCode($url)
    {
        $ua = self::getUserAgent();
        $curlopt_proxy = self::getProxy();
        $curlopt_proxyuserpwd = self::getProxyUserPwd();

        $ch = curl_init($url);
        curl_setopt_array($ch, array(
            CURLOPT_USERAGENT       => $ua,
            CURLOPT_RETURNTRANSFER  => 1,
            CURLOPT_CONNECTTIMEOUT  => 10,
            CURLOPT_FOLLOWLOCATION  => 1,
            CURLOPT_MAXREDIRS       => 2,
            CURLOPT_SSL_VERIFYPEER  => 0,
            CURLOPT_NOBODY          => 1,
        ));
        if($curlopt_proxy) {
            curl_setopt($ch, CURLOPT_PROXY, $curlopt_proxy);
        }
        if($curlopt_proxyuserpwd) {
            curl_setopt($ch, CURLOPT_PROXYUSERPWD, $curlopt_proxyuserpwd);
        }

        curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        return (int)$httpCode;
    }
public static function getHttpCode($url)
    {
        $ua = self::getUserAgent();
        $curlopt_proxy = self::getProxy();
        $curlopt_proxyuserpwd = self::getProxyUserPwd();

        $ch = curl_init($url);
        curl_setopt_array($ch, array(
            CURLOPT_USERAGENT       => $ua,
            CURLOPT_RETURNTRANSFER  => 1,
            CURLOPT_CONNECTTIMEOUT  => 10,
            CURLOPT_FOLLOWLOCATION  => 1,
            CURLOPT_MAXREDIRS       => 2,
            CURLOPT_SSL_VERIFYPEER  => 0,
            CURLOPT_NOBODY          => 1,
        ));
        if($curlopt_proxy) {
            curl_setopt($ch, CURLOPT_PROXY, $curlopt_proxy);
        }
        if($curlopt_proxyuserpwd) {
            curl_setopt($ch, CURLOPT_PROXYUSERPWD, $curlopt_proxyuserpwd);
        }

        curl_exec($ch);
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        return (int)$httpCode;
    }
public static function getHttpCode ( $ url ) { $ ua = self :: getUserAgent ( ) ; $ curlopt_proxy = self :: getProxy ( ) ; $ curlopt_proxyuserpwd = self :: getProxyUserPwd ( ) ; $ ch = curl_init ( $ url ) ; curl_setopt_array ( $ ch , array ( CURLOPT_USERAGENT => $ ua , CURLOPT_RETURNTRANSFER => 1 , CURLOPT_CONNECTTIMEOUT => 10 , CURLOPT_FOLLOWLOCATION => 1 , CURLOPT_MAXREDIRS => 2 , CURLOPT_SSL_VERIFYPEER => 0 , CURLOPT_NOBODY => 1 , ) ) ; if ( $ curlopt_proxy ) { curl_setopt ( $ ch , CURLOPT_PROXY , $ curlopt_proxy ) ; } if ( $ curlopt_proxyuserpwd ) { curl_setopt ( $ ch , CURLOPT_PROXYUSERPWD , $ curlopt_proxyuserpwd ) ; } curl_exec ( $ ch ) ; $ httpCode = curl_getinfo ( $ ch , CURLINFO_HTTP_CODE ) ; curl_close ( $ ch ) ; return ( int ) $ httpCode ; }
HTTP HEAD request with curl.

@access        private
@param         String        $a        The request URL
@return        Integer                 Returns the HTTP status code received in
response to a GET request of the input URL.
HTTP HEAD request with curl .