src/Net/CURL.php
protected function parseHeaderSection( $section )
	{
		$this->header	= NULL;
		$this->caseless = array();
		$headers	= preg_split( "/(\r\n)+/", $section );
		foreach( $headers as $header )
		{
			if( !( trim( $header ) && !preg_match( '/^HTTP/', $header ) ) )
				continue;
			$pair	= preg_split( "/\s*:\s*/", $header, 2 );
			$caselessTag = strtoupper( $pair[0] );
			if( !isset( $this->caseless[$caselessTag] ) )
				$this->caseless[$caselessTag] = $pair[0];
			$this->header[$this->caseless[$caselessTag]][] = $pair[1];
		}
	}
protected function parseHeaderSection( $section )
	{
		$this->header	= NULL;
		$this->caseless = array();
		$headers	= preg_split( "/(\r\n)+/", $section );
		foreach( $headers as $header )
		{
			if( !( trim( $header ) && !preg_match( '/^HTTP/', $header ) ) )
				continue;
			$pair	= preg_split( "/\s*:\s*/", $header, 2 );
			$caselessTag = strtoupper( $pair[0] );
			if( !isset( $this->caseless[$caselessTag] ) )
				$this->caseless[$caselessTag] = $pair[0];
			$this->header[$this->caseless[$caselessTag]][] = $pair[1];
		}
	}
protected function parseHeaderSection ( $ section ) { $ this -> header = NULL ; $ this -> caseless = array ( ) ; $ headers = preg_split ( "/(\r\n)+/" , $ section ) ; foreach ( $ headers as $ header ) { if ( ! ( trim ( $ header ) && ! preg_match ( '/^HTTP/' , $ header ) ) ) continue ; $ pair = preg_split ( "/\s*:\s*/" , $ header , 2 ) ; $ caselessTag = strtoupper ( $ pair [ 0 ] ) ; if ( ! isset ( $ this -> caseless [ $ caselessTag ] ) ) $ this -> caseless [ $ caselessTag ] = $ pair [ 0 ] ; $ this -> header [ $ this -> caseless [ $ caselessTag ] ] [ ] = $ pair [ 1 ] ; } }
Parse an HTTP header section.

As a side effect it stores the parsed header in the
header instance variable.  The header is stored as
an associative array and the case of the headers
as provided by the server is preserved and all
repeated headers (pragma, set-cookie, etc) are grouped
with the first spelling for that header
that is seen.

All headers are stored as if they COULD be repeated, so
the headers are really stored as an array of arrays.

@access		protected
@param		string		$section		Section of HTTP headers
@return		void
Parse an HTTP header section .