laravel - 检索rss

时间:2017-04-01 23:19:30

标签: php laravel rss

我尝试从其他网站检索rss。我使用这个willvincent包。当我尝试检索它时,我遇到错误illegal string offset title

控制器:

$feed = Feeds::make('http://awiacja.imgw.pl/rss/metar00.php?airport=EPWA');
        $data = array(
      'title'     => $feed->get_title(),
      'permalink' => $feed->get_permalink(),
      'items'     => $feed->get_items(),
    );
        return view('home',['data' => $data]);

查看:

  @foreach($data as $datum)
  <li>{{$datum['title']}}</li>
  @endforeach

我想仅从此链接中检索信息:http://awiacja.imgw.pl/rss/metar00.php?airport=EPWA

0 个答案:

没有答案