Name

ini_get()

Synopsis

    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.

Get PHP in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.