What is the role of ini_set() in PHP?

PHPz
Release: 2023-09-23 20:54:01
forward
906 people have browsed it

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;);
?>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!