I am trying to read an attribute value of the root node of an XML fed into the simplexml_load_string() method in PHP.
Here is an example,
<user status="Active">
</user>
I am trying to read the value of 'status' in the above XML string.
--- Here is an update ---
Below is the XML Structure,
<data status="Active">
<user> <userid> 1 </userid> </user>
<user> <userid> 2 </userid> </user>
<data>
The statements below dont work too.. var_dump() outputs "NULL" echo (string)$xml -> user[0] -> userid; echo (string)$xml->attributes()->status
Could some1 lead me on this ?
Regards, Immanuel