Home > Backend Development > PHP Problem > What is the usage of php ini_set

What is the usage of php ini_set

藏色散人
Release: 2023-03-12 10:00:01
Original
2589 people have browsed it

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".

What is the usage of php ini_set

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
Copy after login

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(&#39;display_errors&#39;);
if (!ini_get(&#39;display_errors&#39;)) {
    ini_set(&#39;display_errors&#39;, &#39;1&#39;);
}
echo ini_get(&#39;display_errors&#39;);
?>
Copy after login

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!

Related labels:
source:php.cn
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