Home  >  Article  >  Backend Development  >  What is the role of ini_set() in PHP?

What is the role of ini_set() in PHP?

PHPz
PHPzforward
2023-09-23 20:53:04926browse

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.

Parameters

var name

Not all available options can be changed using ini_set(). There is a list of all available options in the appendix.

New value

The new value of the option.

Example

<?php
   ini_set(&#39;display_errors&#39;, &#39;1&#39;);
?>

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!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete