editing ini files
Posted: Thu Jun 26, 2008 4:13 am
does anyone know how to edit .ini files in php? BY NOT USING fopen() ???
i can read ini files using parse_ini_file("test.ini",true); and set them to arrays but how can i edit a ini file?
it should be easy as reading it. isnt there a function to write an array into a ini file? because i have looked in many places and i cant seem to find a function to do so?
a part of my Ini file:
What i use to read the data:
Now all i need and cant find how to is do the opposite, putting an array into a ini file.?
any ideas anyone?
i can read ini files using parse_ini_file("test.ini",true); and set them to arrays but how can i edit a ini file?
it should be easy as reading it. isnt there a function to write an array into a ini file? because i have looked in many places and i cant seem to find a function to do so?
a part of my Ini file:
Code: Select all
[bob]
pass=house
auth=full
[god]
pass=tree
auth=full
Code: Select all
$ini = parse_ini_file("test.ini",true);
echo "<br />Bobs password is: ".$ini["bob"]["pass"];
echo "<br />God's password is: ".$ini["god"]["pass"];
echo "<br />God's Membership is: ".$ini["god"]["auth"];
any ideas anyone?