I am trying to show the images in rss feed and would appreciate help please.
Here is my code
<?php
function fetch_news(){
$data = file_get_contents('http://feeds.bbci.co.uk/news/rss.xml');
$data = simplexml_load_string($data);
foreach ($data->channel->item as $item) {
$media = $item->children('http://search.yahoo.com/mrss/');
print_r($media->thumbnail[0]->attributes());
}
}
?>
and i am getting the folloing error
Fatal error: Call to a member function
attributes()
on a non-object inC:\wamp\www\ourProject\inc ews_reader.php