tags:

views:

49

answers:

3

Hi I am trying to insert data into xml file. For Ex:

<list>
    <activity>swimming</activity>
    <activity>running</activity>
</list>

In place of swimming i want to insert different data(ex:jogging) How can i do that?

+1  A: 

Use a PHP XML library, such as http://php.net/manual/en/book.simplexml.php . Unfortunately, when you're modifying an XML document with a simple interface, you often have to regenerate the document. If you use a stream-based processor you may be able to avoid this.

Borealid
I got simplexml for only reading..Actually i want to insert data into xml file. can u please send the code
kavita123
@kavita123: You're asking me to spend my time writing code so that you don't have to?
Borealid
A: 

i think this link will help you php xml edit/insert/delete

Jaison Justus
A: 

I am not getting any example for inserting data into xml filr.can u please send code.

kavita123
@kavita: **NO** Nobody's going to send you code! Read the [FAQ](http://stackoverflow.com/faq). If someone told you this was the way to get your questions answered, then they _lied_ to you.
John Saunders