Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

How to solve - Node no longer exist

xml php

This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#1 anjshr7

anjshr7

    CC Lurker

  • New Member
  • Pip
  • 3 posts

Posted 21 July 2015 - 02:31 AM

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(){
 
    $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;
}
 
?>





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download