I have a PHP configuration file which stores settings like:
define("SETTING_1", "");
define("SETTING_2", "");
define("SETTING_3", "");
By default the settings are empty, but then I have an installer file install.php
which basically prompts the user for the settings. What is the best way to open the settings file, find the define for each setting and insert the value? Finally, need to save the settings file to disk.
I want to ovoid using regular expressions or simple string search. I came across token_get_all()
, does it makes sense to use it?