You are here

public static function ServerRequestFactory::get in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php \Zend\Diactoros\ServerRequestFactory::get()

Access a value in an array, returning a default value if not found

Will also do a case-insensitive search if a case sensitive search fails.

Parameters

string $key:

array $values:

mixed $default:

Return value

mixed

3 calls to ServerRequestFactory::get()
ServerRequestFactory::fromGlobals in vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php
Create a request from the supplied superglobal values.
ServerRequestFactory::marshalRequestUri in vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php
Detect the base URI for the request
ServerRequestFactory::marshalUriFromServer in vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php
Marshal the URI from the $_SERVER array and headers

File

vendor/zendframework/zend-diactoros/src/ServerRequestFactory.php, line 88

Class

ServerRequestFactory
Class for marshaling a request object from the current PHP environment.

Namespace

Zend\Diactoros

Code

public static function get($key, array $values, $default = null) {
  if (array_key_exists($key, $values)) {
    return $values[$key];
  }
  return $default;
}