200-710 practice question 10 of 30

How can the id attribute of the 2nd baz element from the XML string below be retrieved from the SimpleXML object found inside $xml? One Two

Full set: 232 questions
Answer options
A: $xml->getElementById('2');
B: $xml->foo->bar->baz[2]['id']
C: $xml->foo->baz[2]['id']
D: $xml->foo->bar->baz[1]['id'] E: $xml->bar->baz[1]['id']
Correct Answer:
E
Scroll to Top