john - 2009-04-16 04:40:59
Thanks for what looks like a great script.. Maybe I am too new to all this, but I just can't figure out how to actually use the class.
I get it to read my XML, and print_r($data); shows me all the info about the xml, but what do I do to actually get one specific piece of information?
What is the exact syntax to return "resultCode" from the XML below?
I think it is something along these lines, can't come up with the right combination to make this work...
$var = $item->key1->attributes();
$value = $var->name;
echo $value;
Thanks!!!
Here is what print_r($data) shows:
simplexmlobject Object
(
[@attributes] => simplexmlobject Object
(
[xmlns:xsi] => http://www.w3.org/2001/XMLSchema-instance
[xmlns:xsd] => http://www.w3.org/2001/XMLSchema
[xmlns] => AnetApi/xml/v1/schema/AnetApiSchema.xsd
)
[messages] => simplexmlobject Object
(
[resultCode] => Error
[message] => simplexmlobject Object
(
[code] => E00039
[text] => A duplicate record with id 360721 already exists.
)
)
)