Loop through children : simplexml_load_string « XML « PHP
- PHP
- XML
- simplexml_load_string
Loop through children
<?php
$xml = simplexml_load_file("books.xml");
foreach($xml->book[2]->cast->children() AS $character) {
echo "$character<br />";
}
?>
Related examples in the same category