Source Code:
(back to article)
<?php $xml = new SimpleXMLElement('<books><book><title>PHP Basics</title><author>John Doe</author></book></books>'); $children = $xml->children(); foreach($children as $child) { echo $child->title . ' - ' . $child->author . "\n"; }
Result:
Report an issue