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,
<data status="Active">
<user> <userid> 1 </userid> </user>
<user> <userid> 2 </userid> </user>
<data>
I am trying to read the value of 'status' in the above XML string:
echo $xml->user[0]->userid;
echo $xml->attributes()->status
The statements don't work too, var_dump() outputs "NULL".