Home  >  Article  >  Backend Development  >  Introduction to several functions of PHP to obtain and operate the configuration file php.ini_PHP Tutorial

Introduction to several functions of PHP to obtain and operate the configuration file php.ini_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 15:03:07825browse

1.ini_get() gets configuration parameters, ini_set() sets configuration parameters

Copy code The code is as follows:

echo ini_get('display_errors'); //1
//Dynamically modify the php.ini configuration information, which will become invalid after the script is executed
ini_set('display_errors',0);
echo ini_get('display_errors');//0

2.ini_get_all() gets all configuration information

Copy code The code is as follows:

//Print all configuration information, a lot. . .
print_r(ini_get_all());

3.ini_restore() restores the configuration information to the original value

Copy code The code is as follows:

echo ini_get('display_errors'); //1
//Dynamically modify the php.ini configuration information, which will become invalid after the script is executed
ini_set('display_errors',0);
ini_restore('display_errors');
echo ini_get('display_errors'); //1

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327869.htmlTechArticle1.ini_get() gets the configuration parameters, ini_set() sets the configuration parameters. Copy the code as follows: ?php echo ini_get ('display_errors'); //1 //Dynamic modification of php.ini configuration information, error after script execution...
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