The value of an ini_get (PHP4, PHP5) configuration option is the value of the environment variable in php. ini. the basic syntax is stringini_get (stringvarname. Return value # success is the string that returns the configuration option value, and null is returned for the null value. If the configuration option does not exist, FALSE is returned. "/>
Ini_get (PHP 4, PHP 5)
Obtains the value of a configuration option.
Is to obtain the value of the environment variable in php. ini.
Basic syntax
String ini_get (string varname)
Function parameters
Varname # Name of the configuration option.
Return value
# Success is a string that returns the configuration option value. if the value is null, an empty string is returned. If the configuration option does not exist, FALSE is returned.
# Note: If the returned value is Boolean, it is 0 or 1.
Case study
For example, the php. ini file contains the following settings:
Register_globals = Off
Post_max_size = 8 M
The PHP part can be obtained as follows:
Echo 'display _ errors = '. ini_get ('display _ errors'). "\ n ";
Echo 'register _ globals = '. ini_get ('register _ globals'). "\ n ";
Echo 'post _ max_size = '. ini_get ('post _ max_size'). "\ n ";
Echo 'post _ max_size + 1 = '. (ini_get ('post _ max_size') + 1). "\ n ";
Echo 'post _ max_size in bytes = '. return_bytes (ini_get ('post _ max_size '));
?>
If you want to obtain the variable value in the entire php. ini file, use the ini_get enhancement function ini_get_all ()
The ini_get_all () function returns the entire php environment variable in the form of an array.
Of course, if you just want to know the php configuration information
Phpinfo ();
?>
More convenient.