Forum Moderators: coopster
I have an object called $foo that returns the following value when I do print_r($foo) - it's an xml feed
I would like to get the value of href in the second array without having to process a loop on the whole object but I don't know how to do that
I tried with echo $object->['href'] but it returns the value of href in the first array
Do I have to make a loop on the whole array with something like 'give the value of [href] if [rel] value = enclosure?
Thanks for your help, here the result of print_r($object)
SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => alternate
[type] => text/xhtml
[title] => Title
[href] => /mapage/toto
)
)
SimpleXMLElement Object
(
[@attributes] => Array
(
[rel] => enclosure
[title] => Title
[width] => 384
[height] => 288
[href] => http://www.example.com/swf/2W7qlUF4jTKH
[type] => application/x-shockwave-flash
)
)
[edited by: eelixduppy at 6:09 pm (utc) on Aug. 27, 2007]
[edit reason] use example (delinked) [/edit]
echo $foo->attributes[1]->url;