Heim  >  Artikel  >  Backend-Entwicklung  >  ini_set /ini_get函数功能-----PHP_PHP教程

ini_set /ini_get函数功能-----PHP_PHP教程

WBOY
WBOYOriginal
2016-07-20 11:13:25881Durchsuche

配置PHP环境时,我们记得最初的一步就是修改php.ini文件,但是当我们在虚拟机中运行脚本,或者是我们因为其他的原因没有修改php.ini的权限时,我们该怎么办?

ini_set()函数提供了在脚本中动态修改php.ini的方法,并且在脚本执行结束后修改失效,因此经常用在程序的配置中。

 

ini_set函数接收两个参数,其一为原始的配置项名称,第二个为要设置该配置项的新值。ini_set和ini_get的合作很合适,示例如下:

 

 
 

并不是所有的配置项都能用ini_set设置,具体能被配置的见附录

 

更详细的请参考:php.net

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/440373.htmlTechArticle配置PHP环境时,我们记得最初的一步就是修改php.ini文件,但是当我们在虚拟机中运行脚本,或者是我们因为其他的原因没有修改php.ini的权...
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn