在PHPinfo中,它会显示ini设置的“Master”和“Local”值.
我想比较它们以确定自脚本启动以来设置是否已更改.
获取本地值很容易:
<?PHP $local = ini_get('setting');
但我找不到任何描述如何获得主值的东西.
解决方法:
我认为get_cfg_var()就是你要找的.
get_cfg_var()
引用a comment in the manual
The difference between ini_get() and get_cfg_var() is as follows: ini_get(): returns the current value in .htaccess or as defined in PHP_INI_USER or PHP_INI_PERDIR get_cfg_var(): returns the values defined in the PHP.ini
The difference between ini_get() and get_cfg_var() is as follows:
ini_get()
ini_get(): returns the current value in .htaccess or as defined in PHP_INI_USER or PHP_INI_PERDIR
get_cfg_var(): returns the values defined in the PHP.ini