ini_get()
The settings made in the ini file can be obtained using this function. It will always return a string. Yes, even values that are numerical such as max_execution_time will be given as a string.
A general use for this function is to check if a setting is on or off. The problem there is that we don’t know exactly what the return value will be. A value for on may come back as “On” or “1″. A value for off could be “Off” or “0″ or even an empty string.
Those are the values PHP understands, however, the actual value could be anything at all. Something could be set to “Onn” which will be interpreted as “Off” so be mindful of what you check against.
$urlOpen = ini_get('allow_url_fopen'); if("1" == $urlOpen or "On" == $urlOpen) { ... } // This may not work if a typo has it set as "Of" for example. // Better to check for the "on" values if("0" == $urlOpen or "Off" == $urlOpen or "" == $urlOpen) { ... } // Not good. "Off" will evaluate to true if($urlOpen) { ... }
