note 7695 added to get_cfg_var

From: Date: Fri, 11 Aug 2000 19:13:08 +0000
Subject: note 7695 added to get_cfg_var
Groups: php.notes 
Request: Send a blank email to php-notes+get-1408@lists.php.net to get a copy of this message
As implemented, this function is an odd wart--it calls cfg_get_string, which returns the value originally set in the config file, if any. Unfortunately, you almost never want to know the original value in the config file. Instead, you want to know the value currently in effect. (These two values can be different if you have no php.ini file, or if you're setting options in httpd.conf or .htaccess files.) Buried in the source code of PHP 4.0.1pl2, you can find an undocumented function named 'ini_get'. This function returns the current value of a configuration option. It has the same interface as get_cfg_var. Here's some sample code: <?= ini_get("register_globals") ?> Don't yell at me if this function disappears in a future release. :-) http://www.php.net/manual/function.get-cfg-var.php

« previous php.notes (#1408) next »