src/VCR/Util/HttpUtil.php
public static function parseHeaders(array $headers)
    {
        $headerGroups = array();
        $headerList = array();

        // Collect matching headers into groups
        foreach ($headers as $line) {
            list($key, $value) = explode(': ', $line, 2);
            if (!isset($headerGroups[$key])) {
                $headerGroups[$key] = array();
            }
            $headerGroups[$key][] = $value;
        }
        
        // Collapse groups
        foreach ($headerGroups as $key => $values) {
            $headerList[$key] = implode(', ', $values);
        }

        return $headerList;
    }
public static function parseHeaders(array $headers)
    {
        $headerGroups = array();
        $headerList = array();

        // Collect matching headers into groups
        foreach ($headers as $line) {
            list($key, $value) = explode(': ', $line, 2);
            if (!isset($headerGroups[$key])) {
                $headerGroups[$key] = array();
            }
            $headerGroups[$key][] = $value;
        }
        
        // Collapse groups
        foreach ($headerGroups as $key => $values) {
            $headerList[$key] = implode(', ', $values);
        }

        return $headerList;
    }
public static function parseHeaders ( array $ headers ) { $ headerGroups = array ( ) ; $ headerList = array ( ) ; // Collect matching headers into groups foreach ( $ headers as $ line ) { list ( $ key , $ value ) = explode ( ': ' , $ line , 2 ) ; if ( ! isset ( $ headerGroups [ $ key ] ) ) { $ headerGroups [ $ key ] = array ( ) ; } $ headerGroups [ $ key ] [ ] = $ value ; } // Collapse groups foreach ( $ headerGroups as $ key => $ values ) { $ headerList [ $ key ] = implode ( ', ' , $ values ) ; } return $ headerList ; }
Returns key value pairs of response headers.

@param array $headers List of headers. Example: ['Content-Type: text/html', '...']
@return array Key/value pairs of headers, e.g. ['Content-Type' => 'text/html']
Returns key value pairs of response headers .