Creating a config file in PHP

前端 未结 10 2131
难免孤独
难免孤独 2020-11-27 10:36

I want to create a config file for my PHP project, but I\'m not sure what the best way to do this is.

I have 3 ideas so far.

1-Use Variable<

10条回答
  •  长情又很酷
    2020-11-27 10:56

    Define will make the constant available everywhere in your class without needing to use global, while the variable requires global in the class, I would use DEFINE. but again, if the db params should change during program execution you might want to stick with variable.

提交回复
热议问题