Home >Backend Development >PHP Tutorial >Dynamically change the system ini configuration-talk about some new functions in php4_PHP tutorial
These functions are
ini_alter — change the configuration parameter value
ini_get — get the configuration parameter value
ini_restore — restore the original configuration parameter value
ini_set — set the configuration parameter value
For example, you can use
print(ini_get("include_path"));
ini_set("include_path","f:");
print(ini_get("include_path"));
ini_restore( "include_path");
print(ini_get("include_path"));
ini_set("include_path","f:php2000");
print(ini_get("include_path"));
?>
The output is (I added newlines for comparison)
f:php2000
f:
f:
f:php2000
I don’t know why the restore error??? ???
In this way, we can change the parameter configuration values at any time in the program. At the same time, I found that when executing again, the default parameters of the system have not changed, that is to say, the change is limited to the current script running period.