I am getting this error on line 14 i.e foreach($media->attributes() as $key => $value)
Warning: fetch_news(): Node no longer exists in D:\Program Files\wamp\www\New folder\ndtv_news.php on line 14
<?php
//fetches articles from NDTV news RSS feed
function fetch_news(){
$attribute = 'http://feeds.feedbur...TV-LatestNews';
$data = file_get_contents('http://feeds.feedbur...V-LatestNews');
$data = simplexml_load_string($data);
$articles = array();
foreach ($data->channel->item as $item){
$media = $item->children('http://search.yahoo.com/mrss');
$image = array();
foreach($media->attributes() as $key => $value)
{
$image[$key] = (string)$value;
}
$articles[] = array('title'=>(string)$item->title,
'description'=>(string)$item->description,
'link'=>(string)$item->link,
'date'=>(string)$item->pubDate,
'image'=>'$image');
}
return $articles;
}
?>