public function Header::add

Add a value to the list of header values

Parameters

string $value Value to add:

string $header The exact header casing to add with. Defaults to the name of the header.:

Return value

Header

1 call to Header::add()
Header::__construct in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Header.php
Construct a new header object

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Header.php, line 68

Class

Header
Represents a header and all of the values stored by that header

Namespace

Guzzle\Http\Message

Code

public function add($value, $header = null) {
  if (!$header) {
    $header = $this
      ->getName();
  }
  if (!array_key_exists($header, $this->values)) {
    $this->values[$header] = array(
      $value,
    );
  }
  else {
    $this->values[$header][] = $value;
  }
  $this
    ->clearCache();
  return $this;
}