proxylib.php
protected function _parseResponseHeaders($headers)
    {
        $headers = str_replace("\r", "", $headers);
        $headers = explode("\n", $headers);
        $parsed  = array();

        foreach($headers as $header)
        {
            $field_end = strpos($header, ':');

            if($field_end === FALSE)
            {
                /* Cover the case where we're at the first header, the HTTP
                 *  status header
                 */
                $field = 'status';
                $value = $header;
            }
            else
            {
                $field = substr($header, 0, $field_end);
                $value = substr($header, $field_end + 1);
            }

            $parsed[$field] = $value;
        }

        return $parsed;
    }
protected function _parseResponseHeaders($headers)
    {
        $headers = str_replace("\r", "", $headers);
        $headers = explode("\n", $headers);
        $parsed  = array();

        foreach($headers as $header)
        {
            $field_end = strpos($header, ':');

            if($field_end === FALSE)
            {
                /* Cover the case where we're at the first header, the HTTP
                 *  status header
                 */
                $field = 'status';
                $value = $header;
            }
            else
            {
                $field = substr($header, 0, $field_end);
                $value = substr($header, $field_end + 1);
            }

            $parsed[$field] = $value;
        }

        return $parsed;
    }
protected function _parseResponseHeaders ( $ headers ) { $ headers = str_replace ( "\r" , "" , $ headers ) ; $ headers = explode ( "\n" , $ headers ) ; $ parsed = array ( ) ; foreach ( $ headers as $ header ) { $ field_end = strpos ( $ header , ':' ) ; if ( $ field_end === FALSE ) { /* Cover the case where we're at the first header, the HTTP
                 *  status header
                 */ $ field = 'status' ; $ value = $ header ; } else { $ field = substr ( $ header , 0 , $ field_end ) ; $ value = substr ( $ header , $ field_end + 1 ) ; } $ parsed [ $ field ] = $ value ; } return $ parsed ; }
Parse out the headers from the response and store them in a key-value
array and return it
@param string $headers A big chunk of text representing the HTTP headers
@return array A key-value array containing heder names and values
Parse out the headers from the response and store them in a key - value array and return it