Can anyone tell me the purpose of using the ini_set function in PHP ?
ini_set('display_errors', 'On');
Above is the code that they have used.
Thanks
Can anyone tell me the purpose of using the ini_set function in PHP ?
ini_set('display_errors', 'On');
Above is the code that they have used.
Thanks
As php documentation:
ini_set — Sets the value of a configuration option
Purpose:
string ini_set ( string $varname , string $newvalue )
Sets the value of the given configuration option. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending.
You can override your config file's value via this method.
Suppose in your php.ini
file, error reporting is configured to false. And for this particular request you want to report error. By using this method you can turn on this error reporting feature. Hope you understand.
ini_set
Sets the value of a configuration option(php.ini)
Your statement will be used for displaying errors, if you will set it to Off
or 0
then it will not display errors.