What if you cannot modify the php. ini configuration file? it's okay. php has a set of functions for setting and retrieving configuration information.
1. ini_get () gets the configuration parameters, and ini_set () sets the configuration parameters.
The code is as follows:
Echo ini_get ('display _ errors '); // 1
// Modify the configuration information of php. ini dynamically, and the script becomes invalid after execution.
Ini_set ('display _ errors ', 0 );
Echo ini_get ('display _ errors '); // 0
2. ini_get_all () get all configuration information
The code is as follows:
// Print all configuration information...
Print_r (ini_get_all ());
3. ini_restore () resumes configuration information to the original value.
The code is as follows:
Echo ini_get ('display _ errors '); // 1
// Modify the configuration information of php. ini dynamically, and the script becomes invalid after execution.
Ini_set ('display _ errors ', 0 );
Ini_restore ('display _ errors ');
Echo ini_get ('display _ errors '); // 1