PHP gets and manipulates several functions of the configuration file php.ini

  • 2020-06-19 09:52:09
  • OfStack

1.ini_get() gets the configuration parameters and ini_set() sets the configuration parameters


<?php
echo ini_get('display_errors'); //1
// The dynamic change php.ini Configuration information, script execution invalidated 
ini_set('display_errors',0);
echo ini_get('display_errors');//0

ini_get_all() gets all configuration information


<?php
// Print all configuration information, huge amount... 
print_r(ini_get_all());

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


<?php
echo ini_get('display_errors'); //1
// The dynamic change php.ini Configuration information, script execution invalidated 
ini_set('display_errors',0);
ini_restore('display_errors');
echo ini_get('display_errors');//1


Related articles: