3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = "<root> <parent> <child name='Child1'>Moi</child> <child name='Child2' /> <subparent> <child name='Child3'>Hei</child> </subparent> </parent> <child name='Child4' /> </root>"; $xml = simplexml_load_string( $xml); $result = $xml->xpath('parent/child'); while(list( , $node) = each($result)) { echo 'b/c: ',$node,"\n"; }