Nested XML Tag in PHP
Now let's have a nested tag:
<root>
<tag>
<elem>text</elem>
</tag>
</root>
Let's get the value of the nested tag. To do this, you need to perform a chain of calls:
<?php
echo $xml->tag->elem; // 'text'
?>
Given the following XML:
<root>
<tag1>
<tag2>
<tag3>
text
</tag3>
</tag2>
</tag1>
</root>
Display the text of the innermost tag on the screen.