My simpleXMLElement output
SimpleXMLElement Object
(
[guid] => 2898580
[title] => England's doomed inevitability?
[description] =>
[link] => http://www.espnfc.com/blog/the-match/60/post/2895340/roy-hodgson-rings-the-changes-but-england-struggle-again
[pubDate] => Jun 20, 2016 04:58 PM PDT
[enclosure] => SimpleXMLElement Object
(
[@attributes] => Array
(
[length] => 150
[url] => http://a.espncdn.com/combiner/i/?img=/photo/2016/0620/r94714_1296x729_16-9.jpg&w=100&h=80&scale=crop&site=espnfc
[type] => image/jpeg
)
)
[category] => null
)
PHP with help of foreach loop when i print in it
echo "Img_Url:".$img_url = $item->enclosure->attributes['url'] ;
it will show blank in there but i write this
echo "Img_Url:".$img_url = $item->enclosure->@attributes['url'] ;
it gives syntax error .
so how can i print this .