Editing an ini file in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
anuantony02
Forum Newbie
Posts: 4
Joined: Mon Nov 09, 2009 5:43 am

Editing an ini file in php

Post 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?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Editing an ini file in php

Post 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.
Post Reply