I can't figure this one out:
$xml = simplexml_load_string($result);
This results in the following (which I can see by view>source in Chrome):
(
[option] => Array
(
[0] => abc1234
[1] => def11234
[2] => ghi1234
[3] => jkl1234
)
[items] => SimpleXMLElement Object
(
[@attributes] => Array
(
[total] => 300
)
[item] => Array
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => NAME1
)
[urls] => SimpleXMLElement Object
(
[@attributes] => Array
(
[url] => example.com
[img] => /image1.png
)
)
)
[1] => SimpleXMLElement Object
(
[@attributes] => Array
(
[name] => NAME2
)
[urls] => SimpleXMLElement Object
(
[@attributes] => Array
(
[url] => example2.com
[img] => /image2.png
)
)
)
)
)
)
This is part of an array with thousands of results. The data that I need are in the 'name,' 'url' and 'image' fields. I have searched tons but the only thing that works is extracting the 'option' values which I don't even need.
How do I extract these values? Thank you