I have a soap call which returns an object which has a xml string.
an example is shown below:
<?xml version="1.0" encoding="utf-16"?>
<LoginResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<StatusCode>1</StatusCode>
<StatusMessage>Login Successful</StatusMessage>
<AuthKey>b2365767-ae42-1a44a6436575</AuthKey>
</LoginResponse>
I would like it to convert it into an associative array which will be similar to:
array(
"LoginResponse"=>array(
"StatusCode"=>1,
"StatusMessage"=>"Login Successful"
"AuthKey"=>"b2365767-ae42-1a44a6436575"
)
);
Hope this makes sense
I have tried simplexml_load_string()
xml2array()
nothing works