i've got an xml-string in $response that looks like this:
<?xml version="1.0"?>
<RESPONSE>
<ERROR>
<ERROR_CODE>6</ERROR_CODE>
<ERROR_TEXT>Authentication failed</ERROR_TEXT>
</ERROR>
</RESPONSE>
In order to read it, I run
$xml_response = simplexml_load_string($response);
The problem is:
$xml_response->getName();
returns - as expected - "RESPONSE", but
isset($xml_response->RESPONSE->ERROR->ERROR_TEXT);
returns FALSE - but why? Any ideas?
Thanks in advance!
$xml_responseis the root node. That's why you should call it$RESPONSEinstead, to avoid the confusion.