public function extractHeaders(){
        $absoluteUrl = $this->getAbsoluteUrl();
        $headersArrRaw = get_headers($absoluteUrl, 1); 
        
        if($headersArrRaw === false){
            throw new \Exception("cannot get headers for {$absoluteUrl}");
        }
        
        $headersArr = array_change_key_case($headersArrRaw, CASE_LOWER);        
        if(isset($headersArr[0]) === true && strpos($headersArr[0], 'HTTP/') !== false){
            $statusStmt = $headersArr[0];
            $statusParts = explode(' ', $statusStmt);
            $headersArr['status-code'] = $statusParts[1];
            
            $statusIndex = strrpos($statusStmt, $statusParts[1])+ strlen($statusParts[1])+1;
            $headersArr['status'] = trim(substr($statusStmt, $statusIndex));
        }
        if(is_array($headersArr['content-type']) === true){
            $headersArr['content-type'] = end($headersArr['content-type']);
        }
        
        return $headersArr;
    }
public function extractHeaders(){
        $absoluteUrl = $this->getAbsoluteUrl();
        $headersArrRaw = get_headers($absoluteUrl, 1); 
        
        if($headersArrRaw === false){
            throw new \Exception("cannot get headers for {$absoluteUrl}");
        }
        
        $headersArr = array_change_key_case($headersArrRaw, CASE_LOWER);        
        if(isset($headersArr[0]) === true && strpos($headersArr[0], 'HTTP/') !== false){
            $statusStmt = $headersArr[0];
            $statusParts = explode(' ', $statusStmt);
            $headersArr['status-code'] = $statusParts[1];
            
            $statusIndex = strrpos($statusStmt, $statusParts[1])+ strlen($statusParts[1])+1;
            $headersArr['status'] = trim(substr($statusStmt, $statusIndex));
        }
        if(is_array($headersArr['content-type']) === true){
            $headersArr['content-type'] = end($headersArr['content-type']);
        }
        
        return $headersArr;
    }
public function extractHeaders ( ) { $ absoluteUrl = $ this -> getAbsoluteUrl ( ) ; $ headersArrRaw = get_headers ( $ absoluteUrl , 1 ) ; if ( $ headersArrRaw === false ) { throw new \ Exception ( "cannot get headers for {$absoluteUrl}" ) ; } $ headersArr = array_change_key_case ( $ headersArrRaw , CASE_LOWER ) ; if ( isset ( $ headersArr [ 0 ] ) === true && strpos ( $ headersArr [ 0 ] , 'HTTP/' ) !== false ) { $ statusStmt = $ headersArr [ 0 ] ; $ statusParts = explode ( ' ' , $ statusStmt ) ; $ headersArr [ 'status-code' ] = $ statusParts [ 1 ] ; $ statusIndex = strrpos ( $ statusStmt , $ statusParts [ 1 ] ) + strlen ( $ statusParts [ 1 ] ) + 1 ; $ headersArr [ 'status' ] = trim ( substr ( $ statusStmt , $ statusIndex ) ) ; } if ( is_array ( $ headersArr [ 'content-type' ] ) === true ) { $ headersArr [ 'content-type' ] = end ( $ headersArr [ 'content-type' ] ) ; } return $ headersArr ; }
extract headers array for the link url
@return array
extract headers array for the link url