Home >Backend Development >PHP Tutorial >ini_set /ini_get function function-----PHP_PHP tutorial

ini_set /ini_get function function-----PHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-20 11:13:25934browse

When configuring the PHP environment, we remember that the first step is to modify the php.ini file, but when we run the script in a virtual machine, or we do not have permission to modify php.ini due to other reasons, we what to do?

The ini_set() function provides a method to dynamically modify php.ini in a script, and the modification becomes invalid after the script is executed, so it is often used in program configuration.

The ini_set function receives two parameters, one is the original configuration item name, and the second is the new value of the configuration item to be set. The cooperation between ini_set and ini_get is very suitable. The example is as follows:

Not all configuration items can be set with ini_set. For details, see the appendix

For more details, please refer to: php.net

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/440373.htmlTechArticleWhen configuring the PHP environment, we remember that the first step is to modify the php.ini file, but when we are in the virtual machine Run the script, or we do not have the right to modify php.ini for other reasons...
Statement:
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