Hiyo,
I frequently work with XML and PHP but this specific return I'm getting is throwing a curveball as to how to get it in PHP. I would LOVE if I could convert the "$attribute" and "VALUE" to an assoc array some how.
Really stumped and frustrated -Ray
SimpleXMLElement Object
(
[MULTIPLE] => SimpleXMLElement Object
(
[SINGLE] => SimpleXMLElement Object
(
[KEY] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => address
)
[VALUE] => SimpleXMLElement Object
(
[@attributes] => Array
(
[null] => null
)
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => aim
)
[VALUE] => SimpleXMLElement Object
(
[@attributes] => Array
(
[null] => null
)
)
)
[2] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => auth
)
[VALUE] => SimpleXMLElement Object
(
[@attributes] => Array
(
[null] => null
)
)
)
UPDATE: Here is the XML output:
<?xml version="1.0" encoding="UTF-8" ?>
<RESPONSE>
<MULTIPLE>
<SINGLE>
<KEY name="address"><VALUE null="null"/>
</KEY>
<KEY name="aim"><VALUE null="null"/>
</KEY>
<KEY name="auth"><VALUE null="null"/>
</KEY>
<KEY name="city"><VALUE null="null"/>
</KEY>
<KEY name="confirmed"><VALUE null="null"/>
</KEY>
<KEY name="country"><VALUE null="null"/>
</KEY>
<KEY name="deleted"><VALUE null="null"/>
</KEY>
<KEY name="department"><VALUE null="null"/>
</KEY>
<KEY name="description"><VALUE null="null"/>
</KEY>
<KEY name="email"><VALUE null="null"/>
</KEY>
<KEY name="emailstop"><VALUE null="null"/>
</KEY>
<KEY name="error"><VALUE>no match found for idnumber = 301942</VALUE>
</KEY>
<KEY name="firstname"><VALUE null="null"/>
...
I know how to parse the XML when it is formed in the manner described in that tutorial. But this specific case has me stumped as how to access the nodes I need (Either through SimpleXML object or converting it to a PHP array WITHOUT going through the nodes like this:
$xml_obj->MULTIPLE->SINGLE->KEY[9]->VALUE
give this a read, it will show you a brief tutorial