Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<gc_statusget_current_user>
^PHP Options/Info FunctionsLast updated: Mon, 26 Oct 2026

get_cfg_var

(PHP 4, PHP 5, PHP 7, PHP 8)

get_cfg_var — Gets the value of a PHP configuration option

Description

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

Gets the value of a PHP configuration option.

This function will not return configuration information set when the PHP was compiled, or read from an Apache configuration file.

To check whether the system is using a configuration file, try retrieving the value of the cfg_file_path configuration setting. If this is available, a configuration file is being used.

Parameters

option

The configuration option name.

Return Values

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

See Also


<gc_statusget_current_user>
^PHP Options/Info FunctionsLast updated: Mon, 26 Oct 2026