src/Zicht/Bundle/UrlBundle/Service/UrlValidator.php
protected function getStatusCode(array $headers)
    {
        $status = 0;
        foreach ($headers as $header) {
            if (preg_match('#^HTTP/(?:[^\s]+)\s(?P<code>\d+)\s#', $header, $match)) {
                $status = (int)$match['code'];
            }
        }
        return $status;
    }
protected function getStatusCode(array $headers)
    {
        $status = 0;
        foreach ($headers as $header) {
            if (preg_match('#^HTTP/(?:[^\s]+)\s(?P<code>\d+)\s#', $header, $match)) {
                $status = (int)$match['code'];
            }
        }
        return $status;
    }
protected function getStatusCode ( array $ headers ) { $ status = 0 ; foreach ( $ headers as $ header ) { if ( preg_match ( '#^HTTP/(?:[^\s]+)\s(?P<code>\d+)\s#' , $ header , $ match ) ) { $ status = ( int ) $ match [ 'code' ] ; } } return $ status ; }
Parse the headers array and search for the status pattern

@param array $headers
@return int
Parse the headers array and search for the status pattern