Home > Article > Backend Development > What is the role of ini_set() in PHP?
PHP allows users to modify some settings mentioned in php.ini using ini_set(). This function requires two string parameters. The first is the name of the setting to be modified, and the second is the new value to be assigned to it.
Not all available options can be changed using ini_set(). There is a list of all available options in the appendix.
The new value of the option.
<?php ini_set('display_errors', '1'); ?>
The given line of code will enable the script's display_error setting if it is disabled. We need to place the above statement at the top of the script so that the setting remains enabled until the end. Additionally, values set via ini_set() only apply to the current script. After this, PHP will start using the original value from php.ini.
The above is the detailed content of What is the role of ini_set() in PHP?. For more information, please follow other related articles on the PHP Chinese website!