protected function HeaderComparison::hasKey

Case insensitive check if an array have a key

Parameters

string $key Key to check:

array $array Array to check:

Return value

bool

1 call to HeaderComparison::hasKey()
HeaderComparison::compareArray in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/HeaderComparison.php
Check if an array of HTTP headers matches another array of HTTP headers while taking * into account as a wildcard

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/HeaderComparison.php, line 118

Class

HeaderComparison
Class used to compare HTTP headers using a custom DSL

Namespace

Guzzle\Http\Message

Code

protected function hasKey($key, $array) {
  foreach (array_keys($array) as $k) {
    if (!strcasecmp($k, $key)) {
      return true;
    }
  }
  return false;
}