src/url_fetcher.php
function getResponseHeaders($options = array()){
		$options = array_merge(array(
			"as_hash" => false,
			"lowerize_keys" => false
		),$options);

		$this->fetchContent();

		$out = $this->_ResponseHeaders;

		if($options["as_hash"]){
			$headers = explode("\n",$out);
			$out = array();
			foreach($headers as $h){
				if(preg_match("/^([^ ]+):(.*)/",trim($h),$matches)){
					$key = $options["lowerize_keys"] ? strtolower($matches[1]) : $matches[1];
					$out[$key] = trim($matches[2]);
				}
			}
		}

		return $out;
	}
function getResponseHeaders($options = array()){
		$options = array_merge(array(
			"as_hash" => false,
			"lowerize_keys" => false
		),$options);

		$this->fetchContent();

		$out = $this->_ResponseHeaders;

		if($options["as_hash"]){
			$headers = explode("\n",$out);
			$out = array();
			foreach($headers as $h){
				if(preg_match("/^([^ ]+):(.*)/",trim($h),$matches)){
					$key = $options["lowerize_keys"] ? strtolower($matches[1]) : $matches[1];
					$out[$key] = trim($matches[2]);
				}
			}
		}

		return $out;
	}
function getResponseHeaders ( $ options = array ( ) ) { $ options = array_merge ( array ( "as_hash" => false , "lowerize_keys" => false ) , $ options ) ; $ this -> fetchContent ( ) ; $ out = $ this -> _ResponseHeaders ; if ( $ options [ "as_hash" ] ) { $ headers = explode ( "\n" , $ out ) ; $ out = array ( ) ; foreach ( $ headers as $ h ) { if ( preg_match ( "/^([^ ]+):(.*)/" , trim ( $ h ) , $ matches ) ) { $ key = $ options [ "lowerize_keys" ] ? strtolower ( $ matches [ 1 ] ) : $ matches [ 1 ] ; $ out [ $ key ] = trim ( $ matches [ 2 ] ) ; } } } return $ out ; }
Gets headers returned by the server.

@param array $options
- <b>as_hash</b> - returns headers as array when set to true [default: false]
- <b>lowerize_keys</b> - convert header names lowercase when set to true [default: false]
@return string|array
Gets headers returned by the server .