Get node value from document
- by J Noel
I have XML in PHP, I am trying to get the value of the status node:
<?xml version="1.0" encoding="utf-8" ?>
<response>
<result>
<form name="MREP">
<update>
<criteria>
<field name="Serial_Number" compOperator="Equals" value="A-000-1012"></field>
<reloperator>AND</reloperator>
<field name="MREP_Type" compOperator="Equals" value="0"></field>
</criteria>
<newvalues>
<field name="Is_being_Used">
<value><![CDATA[TRUE]]></value>
</field>
</newvalues>
<status>Success</status>
</update>
</form>
</result>
</response>
I tried
$xml = simplexml_load_string($mrepValide);
echo $xml->status;
(where $mrepValide is a string of XML shown above)
But I think it didnt work since status is not the parent node. Any help would be greatly appreciated.