Requests_Response_Headers::offsetGet

Advertisement

Summery Summery

Get the given header

Syntax Syntax

Requests_Response_Headers::offsetGet( string $key )

Description Description

Unlike 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.

Parameters Parameters

$key

(Required)

Return Return

(string) Header value

Source Source

File: wp-includes/Requests/Response/Headers.php

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

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

Advertisement

Advertisement

Leave a Reply