Note: By putting your code into your question, you will make it easier for others to help you.
$xml = simplexml_load_string($x); // assume XML in $x
You will need 2 nested loops to iterate. First, you will want to select the <OrdersList>
-nodes correctly, see the outer loop.
foreach ($xml->OrdersList as $orders) {
The children of <OrdersList>
are namespaced
:
$order->OrderNumber
doesn't work, but the children()
-method does the job:
foreach ($orders->children("typ", TRUE) as $name => $value) {
echo "$name: $value <br />";
}
}
see it working: http://viper-7.com/bS2pEJ
Recommended reading: http://www.php.net/manual/en/simplexmlelement.children.php