I have an XML which is as follows.
<statuses type="array">
<status>
<created_at>Thu Oct 20 09:49:46 +0000 2011</created_at>
<text>@pkprasad82 Hello</text>
<entities>
<user_mentions>
<user_mention end="11" start="0">
<id>133809164</id>
<screen_name>pkpras</screen_name>
<name>prav</name>
</user_mention>
</user_mentions>
<urls/>
<hashtags/>
</entities>
</status>
<status>
<created_at>Thu Oct 20 09:49:46 +0000 2011</created_at>
<text>hello Hello</text>
<entities>
<user_mentions>
<user_mention end="11" start="0">
<id>123456789</id>
<screen_name>pkpras</screen_name>
<name>pravin</name>
</user_mention>
</user_mentions>
<urls/>
<hashtags/>
</entities>
</status>
<statuses>
I want to access only “id” tag for both “status” tag in php.I do not want any other tag.
For Example
Id=133809164
Id=123456789
Consider using SimpleXML like so:
The output produced in this case is: