October 2005
Intermediate to advanced
372 pages
11h 35m
English
ini_get()
string ini_get ( string varname )The ini_get()
function allows you to read a value from the php.ini file without altering it. It takes the name of the value to read as its only parameter and returns the value. Boolean values returned by ini_get() should be typecasted as integer; otherwise, false values will be returned as an empty string. For example:
print "Display_errors is turned on: ";
print (int) ini_get("display_errors");Many numerical values in php.ini are represented using M for megabyte and other shortcuts. These are preserved in the return value of ini_get(), which means you should not rely on these values to be plain numbers.