开发者

php code to insert data into xml file

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

<list>
    <activity>swimming</activity>
    <acti开发者_运维百科vity>running</activity>
</list>

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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜