SimpleXMLElement to PHP Array

Posted by Codex73 on Stack Overflow See other posts from Stack Overflow or by Codex73
Published on 2010-04-28T02:35:01Z Indexed on 2010/04/28 2:43 UTC
Read the original article Hit count: 339

Filed under:
|
|
|

Variable $d comes from file_get_contents function to a url.

$answer = @new SimpleXMLElement($d);

Below is output of the print_r($answer):

SimpleXMLElement Object ( [Amount] => 2698 [Status] => OK [State] => FL [Country] => USA )

How can I retrieve value of each element and add to an array? can't figure it out.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about simplexml