private static function headers_to_array($headerContent) {
		$headers = array();
		$arrRequests = explode("\r\n\r\n", $headerContent);
		foreach (explode("\r\n", $arrRequests[0]) as $i => $line) {
			if ($i === 0) {
				$headers['http_code'] = $line;
			} else {
				list($key, $value) = explode(': ', $line);
				$headers[$key] = $value;
			}
		}
		return $headers;
	}
private static function headers_to_array($headerContent) {
		$headers = array();
		$arrRequests = explode("\r\n\r\n", $headerContent);
		foreach (explode("\r\n", $arrRequests[0]) as $i => $line) {
			if ($i === 0) {
				$headers['http_code'] = $line;
			} else {
				list($key, $value) = explode(': ', $line);
				$headers[$key] = $value;
			}
		}
		return $headers;
	}
private static function headers_to_array ( $ headerContent ) { $ headers = array ( ) ; $ arrRequests = explode ( "\r\n\r\n" , $ headerContent ) ; foreach ( explode ( "\r\n" , $ arrRequests [ 0 ] ) as $ i => $ line ) { if ( $ i === 0 ) { $ headers [ 'http_code' ] = $ line ; } else { list ( $ key , $ value ) = explode ( ': ' , $ line ) ; $ headers [ $ key ] = $ value ; } } return $ headers ; }
Converts a string containing multiple headers into an array that can be used programatically.
@param  string $headerContent A header string
@return array An indexable array of headers
Converts a string containing multiple headers into an array that can be used programatically .