Possible Duplicate:
Reading and Writing Configuration Files
Okay, I have a config file, which contains some information that I would like the user to be able to change. I've already thought about holding the information in a MySQL table but this isn't a good idea as I've got my Database class included AFTER my configuration variables and this would mess up my code structure.
Any idea how to read/write variables/specific lines of a file? Here's my global config file.>
error_reporting(E_ALL);
/*
The parameters used site-wide
First set are Datbase parameters
And second set are the salts used to generate strings
*/
$params['db']['host'] = 'localhost';
$params['db']['username'] = 'root';
$params['db']['password'] = 'waffliner';
$params['db']['db_name'] = 'habcms';
$params ['core']['salt1'] = "184962574320355793361124913390";
$params['core']['salt2'] = "13952134426315134482857516025";
$params['core']['timeout'] = "60 minutes";
try {
include_once("core.inc.php");
include_once("db.inc.php");
include_once("user.inc.php");
} catch(exception $e) {
echo $e->getMessage();
}
?>