ini_get_all()

ini_get_all() — Gets all configuration options.

Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.2.0, 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

ini_get_all(?string $extension = null, bool $details = true): array|false

Parameters

ParameterTypeWhat it takes
$extension?stringAn optional extension name. If not null or the string core, the function returns only options specific for that extension.
$detailsboolRetrieve details settings or only the current value for each setting. Default is true (retrieve details).

Return value

Returns an associative array with directive name as the array key. Returns false and raises an E_WARNING level error if the extension doesn't exist. When details is true (default) the array will contain global_value (set in php.ini), local_value (perhaps set with ini_set() or .htaccess), builtin_default_value (the built-in default value of the directive, or null if it has none, independent of values set in php.ini, on the command line, or at runtime), and access (the access level). When details is false the value will be the current value of the option. See the manual section for information on what access levels mean. Note: It's possible for a directive to have multiple access levels ...

Example

A runnable snippet:

print_r(ini_get_all("pcre")); print_r(ini_get_all());

Output:

Array ( [pcre.backtrack_limit] => Array ( [global_value] => 100000 [local_value] => 100000 [builtin_default_value] => 100000 [access] => 7 ) [pcre.recursion_limit] => Array ( [global_value] => 100000 [local_value] => 100000 [builtin_default_value] => 100000 [access] => 7 ) ) Array ( [allow_call_time_pass_reference] => Array ( [global_value] => 0 [local_value] => 0 [builtin_default_value] => 0 [access] => 6 ) [allow_url_fopen] => Array ( [global_value] => 1 [local_value] => 1 [builtin_default_value] => 1 [access] => 4 ) ... )

Changelog

VersionChange
8.6.0The builtin_default_value element was added to the details array returned for each directive.

See also

ini_get(), ini_restore(), ini_set(), get_loaded_extensions(), phpinfo()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page ini_get_all() (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.