/ Published in: PHP
Expand |
Embed | Plain Text
<?php // first <winner id="1" /> node $xml = '<win visit="0"> <winner id="1" /> </win>'; $xml = simplexml_load_string($xml); // second node $newNode = $xml->addChild("winner"); $newNode->addAttribute("id","2"); // three node $newNode = $xml->addChild("winner"); $newNode->addAttribute("id","3"); ?> // RESULT <win visit="0"> <winner id="1"/> <winner id="2"/> <winner id="3"/> </win>
Comments
Subscribe to comments
You need to login to post a comment.

in firefox view result from CTRL+U, in Opera is no problem show result without shortcut:)