Requests_Utility_CaseInsensitiveDictionary::offsetGet() WordPress Method

The offsetGet() method is a utility function provided by the Requests_Utility_CaseInsensitiveDictionary class. This function returns the value associated with the specified key from the dictionary, with the key being case-insensitive. This is useful when working with data that is not consistently formatted, such as when data is coming from a user-inputted form.

Requests_Utility_CaseInsensitiveDictionary::offsetGet( string $key ) #

Get the value for the item


Parameters

$key

(string)(Required)Item key


Top ↑

Return

(string|null) Item value (null if offsetExists is false)


Top ↑

Source

File: wp-includes/Requests/Utility/CaseInsensitiveDictionary.php

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

		return $this->data[$key];
	}

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.