protected function parseHeaders($headersStr)
    {
        $headersArr  = array();
        $headersHlpr = explode("\r\n", $headersStr);

        foreach ($headersHlpr as $header) {
            $pos = strpos($header, ':');
            if ($pos === false) {
                $headersArr[] = trim($header);
            } else {
                $headersArr[trim(substr($header, 0, $pos))] = trim(substr($header, ($pos + 1)));
            }
        }

        return $headersArr;
    }
protected function parseHeaders($headersStr)
    {
        $headersArr  = array();
        $headersHlpr = explode("\r\n", $headersStr);

        foreach ($headersHlpr as $header) {
            $pos = strpos($header, ':');
            if ($pos === false) {
                $headersArr[] = trim($header);
            } else {
                $headersArr[trim(substr($header, 0, $pos))] = trim(substr($header, ($pos + 1)));
            }
        }

        return $headersArr;
    }
protected function parseHeaders ( $ headersStr ) { $ headersArr = array ( ) ; $ headersHlpr = explode ( "\r\n" , $ headersStr ) ; foreach ( $ headersHlpr as $ header ) { $ pos = strpos ( $ header , ':' ) ; if ( $ pos === false ) { $ headersArr [ ] = trim ( $ header ) ; } else { $ headersArr [ trim ( substr ( $ header , 0 , $ pos ) ) ] = trim ( substr ( $ header , ( $ pos + 1 ) ) ) ; } } return $ headersArr ; }
Build the HTTP response array out of the headers string

@param  string $headersStr

@return array
Build the HTTP response array out of the headers string