Headers::offsetSet( string $offset, string $value )

In this article

Set the given item

Parameters

$offsetstringrequired
Item name
$valuestringrequired
Item value

Source

public function offsetSet($offset, $value) {
	if ($offset === null) {
		throw new Exception('Object is a dictionary, not a list', 'invalidset');
	}

	if (is_string($offset)) {
		$offset = strtolower($offset);
	}

	if (!isset($this->data[$offset])) {
		$this->data[$offset] = [];
	}

	$this->data[$offset][] = $value;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.