Requests_Response_Headers::offsetGet()publicWP 1.0

Get the given header

Unlike {@see self::getValues()}, this returns a string. If there are multiple values, it concatenates them with a comma as per RFC2616.

Avoid using this where commas may be used unquoted in values, such as Set-Cookie headers.

{} It's a method of the class: Requests_Response_Headers{}

No Hooks.


String|null. Header value


$Requests_Response_Headers = new Requests_Response_Headers();
$Requests_Response_Headers->offsetGet( $key );
$key(string) (required)

Code of Requests_Response_Headers::offsetGet() WP 6.0

public function offsetGet($key) {
	$key = strtolower($key);
	if (!isset($this->data[$key])) {
		return null;

	return $this->flatten($this->data[$key]);