Skip to content

Kirby 5.0.4

$environment->get()

Gets a value from the server environment array

$environment->get(string|false|null $key = null, mixed $default = null)

Parameters

Name Type Default Description
$key stringorfalseornull null The key to look for. Pass false or null
to return the entire server array.
$default mixed null Optional default value, which should be
returned if no element has been found

Parent class

Kirby\Http\Environment

Examples

// sample output: /var/www/kirby
$server->get('document_root');