<?php $str = <<<XML <foo> <bar> <baz id="1">One</baz> <baz id="2">Two</baz> </bar> </foo> XML; $xml = simplexml_load_string($str); echo $xml->bar->baz[1]['id'];
You have javascript disabled. You will not be able to edit any code.