src/Request.php
protected function parseHeaders($headers)
    {
        $headers = str_replace("\r\n", "\n", $headers);
        $headers = explode("\n", $headers);

        array_shift($headers);

        $parsedHeaders = [];
        foreach ($headers as $header) {
            list($key, $value) = explode(':', $header, 2);

            $parsedHeaders[$key] = trim($value);
        }

        return $parsedHeaders;
    }
protected function parseHeaders($headers)
    {
        $headers = str_replace("\r\n", "\n", $headers);
        $headers = explode("\n", $headers);

        array_shift($headers);

        $parsedHeaders = [];
        foreach ($headers as $header) {
            list($key, $value) = explode(':', $header, 2);

            $parsedHeaders[$key] = trim($value);
        }

        return $parsedHeaders;
    }
protected function parseHeaders ( $ headers ) { $ headers = str_replace ( "\r\n" , "\n" , $ headers ) ; $ headers = explode ( "\n" , $ headers ) ; array_shift ( $ headers ) ; $ parsedHeaders = [ ] ; foreach ( $ headers as $ header ) { list ( $ key , $ value ) = explode ( ':' , $ header , 2 ) ; $ parsedHeaders [ $ key ] = trim ( $ value ) ; } return $ parsedHeaders ; }
Parse HTTP response headers.

@param string $headers The raw, unparsed response headers.

@return array Headers as key–value pairs.
Parse HTTP response headers .