Home > Article > Backend Development > What is the usage of php ini_set
php The ini_set function is to set the value for a configuration option. Its usage syntax is "ini_set(string $varname, string $newvalue): string".
The operating environment of this article: Windows7 system, PHP7.1 version, Dell G3 computer
What is the usage of php ini_set?
php ini_set - Set the value for a configuration option
Description
ini_set(string $varname, string $newvalue): string
Set the value of the specified configuration option. This option will retain its new value while the script is running, and will be restored when the script ends.
Parameter varname: Not all valid options can be changed with ini_set(). There is an appendix with a list of valid options.
newvalue: The new value of the option.
Return value: Return the old value on success, return false on failure.
Example:
Set an ini option
<?php echo ini_get('display_errors'); if (!ini_get('display_errors')) { ini_set('display_errors', '1'); } echo ini_get('display_errors'); ?>
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What is the usage of php ini_set. For more information, please follow other related articles on the PHP Chinese website!