SimpleXMLElement to PHP Array
- by Codex73
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.