It generates this
XML:
- HTML: Select all
<?xml version="1.0" encoding="utf-8"?>
<numbers>
<no>1</no>
<no>2</no>
<no>3</no>
<numbers>
<no>4</no>
<no>5</no>
<no>6</no>
<no>7</no>
<no>8</no>
<no>x</no>
....
edit!
This code generates the right
XML but I still can't get it to loop through.
- PHP: Select all
<?php
define('XML', 'numbers.xml');
$xml = new SimpleXMLElement(XML, NULL, true);
$numbers = $xml;
for($i = 4; $i < 200; $i++) {
$numbers->addChild('no', $i);
}
foreach($xml as $n) {echo $n.'<br';}
$xml->asXML(XML);
?>