3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1' /> <child name='Child2' /> <subparent> <child name='Child3' /> </subparent> </parent> <child name='Child4' /> </root>"; $xml = simplexml_load_string( $xml); $node = $xml->xpath( '//child[@name="Child2"]/*'); echo $node;

preferences:
40.73 ms | 402 KiB | 5 Q