create arbitrary values in php.ini

前端 未结 2 1861
孤城傲影
孤城傲影 2021-01-18 03:43

I would like to put some of my app config data in php.ini
I tried just to add new values there and then get them with ini_get
I get nothing displayed. D

相关标签:
2条回答
  • 2021-01-18 04:39

    Have you looked at get_cfg_var( config_var )?

    http://www.php.net/manual/en/function.get-cfg-var.php

    I believe this is for retrieving custom variables from e.g. the servers php.ini file

    0 讨论(0)
  • Don't use php.ini to configure your application, it's not the right place (as the name says, it's intended to configure php, not any application using it).

    If you want to use ini files for your application's configuration, have a look at parse_ini_file()

    0 讨论(0)
提交回复
热议问题