Xml add element node using PHP

Posted by user560411 on Stack Overflow See other posts from Stack Overflow or by user560411
Published on 2011-01-09T17:49:32Z Indexed on 2011/01/09 17:53 UTC
Read the original article Hit count: 277

Filed under:
|

Hello I would like to add an element node in my entire XML file using PHP. I can not get it right and I add it below root. Please share me a clean code so that I understand how it works.. Thank you! My xml is

<?xml version="1.0" encoding="utf-8"?>
<GameStore>

    <Game type="adventure">
    <TITLE>Assassin's Creed: Brotherhood</TITLE>
    <PUBLISHER>Ubisoft</PUBLISHER>
    </Game> 

    <Game type="adventure">
    <TITLE>Batman: Arkham Asylum</TITLE>
    <PUBLISHER>Eidos</PUBLISHER>
    </Game>

    </GameStore>

© Stack Overflow or respective owner

Related posts about php

Related posts about Xml