get_cfg_var()

get_cfg_var() — Gets the value of a PHP configuration option.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.

Signature

get_cfg_var(string $option): string|array|false

Parameters

ParameterTypeWhat it takes
$optionstringThe configuration option name.

Return value

Returns the current value of the PHP configuration variable specified by option, or false if an error occurs.

Example

The PHP manual ships no example for get_cfg_var(); the signature and the parameter table above are the contract.

See also

ini_get(), ini_get_all()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page get_cfg_var() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.