XML Tag Text in PHP
Suppose we have one tag in XML:
<root>
<tag>text</tag>
</root>
Let's get the text of this tag.
Its value will be stored
in the property of the object $xml:
<?php
echo $xml->tag; // outputs 'text'
?>
Given the following XML:
<root>
<name>john</name>
</root>
Display the user's name.
Given the following XML:
<root>
<user>
<name>john</name>
<surn>smit</surn>
</user>
</root>
Display the user's first and last name.