php - RSS images using SimpleXml not displaying.Works for .xml RSS feeds but not with .cms -


i

main(): node no longer exists

while trying display images (media:content)from rss url. have been trying solve not successful . can explain me why error displaying , me solve it.the code works if parsed rss feeds urls .xml extension not .cms extension urls.i dont know why happening or whats wrong code.

my view

 foreach ($data1 $key1 => $value1) {                      $image=$data1[$key1]['image']->children('http://search.yahoo.com/mrss/')->content->attributes()->url;                      echo '<p>'.$image.'</p>';                      echo '<div class="col-lg-6">';                     echo '<img src="'.$image.'" /><strong style="color:pink;">'.$data1[$key1]["title"].'</strong>';                     echo '<p>'.$data1[$key1]["description"].'</p>';                     echo '<p>'.$data1[$key1]["pubdate"].'</p>';                     echo '</div>';                  } 

my controller

foreach($urls $key => $url){          $xml = simplexml_load_file($url);          $result[$key]['title'] = $xml->channel->title;          $data = [];          ($i=0; $i<5 ; $i++) {          # code...             $items = [];             if($xml->channel->item[$i] == null)             {                 break;             }              $items['title'] = $xml->channel->item[$i]->title;             $items['link'] = $xml->channel->item[$i]->link;             $items['description'] = $xml->channel->item[$i]->description;             $items['pubdate'] = $xml->channel->item[$i]->pubdate;             $items['image'] = $xml->channel->item[$i];              $data[$i] = $items;          }          $result[$key]['data'] = $data;          //$entries = array_merge($worldfeed,$entries);      }            return view::make('index')->with('result',$result); 


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -