Page 1 of 1

Editing an ini file in php

Posted: Wed Jan 20, 2010 12:27 am
by anuantony02
I have an ini file called myvalues.ini which I use to store some configuration values. The admin can also change the values in this ini file from front end. How do I write the code in php to edit the ini file.
Following is the structure of myvalues.ini file

myvalues
[Values]
value1=test1
value2=test2
value3=test3
value4=test4
value5=test5

Suppose i want to update the values from test1,test2...test5 to newtest1,newtest2..newtest5. How do I do it using php?

Re: Editing an ini file in php

Posted: Wed Jan 20, 2010 10:22 am
by McInfo
A good place to start is the manual page for parse_ini_file(). A few of the comments deal with writing back to an ini file.

Edit: This post was recovered from search engine cache.