/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // first <winner id="1" /> node $xml = '<win visit="0"> <winner id="1" /> </win>'; // second node $newNode = $xml->addChild("winner"); $newNode->addAttribute("id","2"); // three node $newNode = $xml->addChild("winner"); $newNode->addAttribute("id","3"); echo $xml->asXML(); ?> // RESULT <win visit="0"> <winner id="1"/> <winner id="2"/> <winner id="3"/> </win>
Comments
