<?xml version='1.0'?>
<error>
<error_detail code="0">Successfully</error_detail>
<error_detail code="1">Invalid Username or Password</error_detail>
<error_detail code="2">No username or password</error_detail>
<error_detail code="3">Session has expired</error_detail>
<error_detail code="4">Date of effectivity cannot be less than</error_detail>
</error>
How can I get the "session has expired" using xpath?
I tried:
$xml = simplexml_load_string($xml_string);
$a = $xml->xpath("//error_detail[@code='3']");
display_output($a);
I am getting this instead:
array ( 0 => SimpleXMLElement::__set_state(array( '@attributes' => array ( 'code' => '53', ), )), )