I have the following XML file:
<?xml version="1.0" encoding="UTF-8"?>
<result name="response">
<doc>
<str name="index">2</str>
<str name="summary">A summary</str>
<str name="title">A Title</str>
<arr name="media">
<str>/image/123.jpg</str>
</arr>
</doc>
</result>
I'm grabbing the contents and creating a SimpleXMLElement in PHP. I need to be able to grab the contents of a specific tag based on it's name value. E.g. If I was trying to echo out "A summary" something like this:
echo $xmlObj->doc->str['name']->summary;
I know that doesn't work but what will? I've looked at a lot of similar questions but haven't found one with this specific problem. Cheers.