Requests_Response_Headers::offsetGet() – Get the given header

You appear to be a bot. Output may be restricted

Description

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.

Usage

$string|null = Requests_Response_Headers::offsetGet( $key );

Parameters

$key
( string ) required

Returns

string|null Header value

Source

File name: wordpress/wp-includes/Requests/Response/Headers.php
Lines:

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

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

 View on GitHub View on Trac