You are here

public function MessageTrait::hasHeader in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-diactoros/src/MessageTrait.php \Zend\Diactoros\MessageTrait::hasHeader()
  2. 8 vendor/guzzlehttp/psr7/src/MessageTrait.php \GuzzleHttp\Psr7\MessageTrait::hasHeader()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/MessageTrait.php \Zend\Diactoros\MessageTrait::hasHeader()

Checks if a header exists by the given case-insensitive name.

Parameters

string $header Case-insensitive header name.:

Return value

bool Returns true if any header names match the given header name using a case-insensitive string comparison. Returns false if no matching header name is found in the message.

5 calls to MessageTrait::hasHeader()
MessageTrait::getHeader in vendor/zendframework/zend-diactoros/src/MessageTrait.php
Retrieves a message header value by the given case-insensitive name.
MessageTrait::withAddedHeader in vendor/zendframework/zend-diactoros/src/MessageTrait.php
Return an instance with the specified header appended with the given value.
MessageTrait::withoutHeader in vendor/zendframework/zend-diactoros/src/MessageTrait.php
Return an instance without the specified header.
Request::getHeader in vendor/zendframework/zend-diactoros/src/Request.php
Retrieves a message header value by the given case-insensitive name.
Request::getHeaders in vendor/zendframework/zend-diactoros/src/Request.php
Retrieves all message headers.

File

vendor/zendframework/zend-diactoros/src/MessageTrait.php, line 112

Class

MessageTrait
Trait implementing the various methods defined in MessageInterface.

Namespace

Zend\Diactoros

Code

public function hasHeader($header) {
  return array_key_exists(strtolower($header), $this->headerNames);
}