メインコンテンツまでスキップ

RSS::fetchAll

RSSフィードのすべてのレコードまたは指定された数のレコードを取得

説明

public self RSS::fetchAll( [ number $max = 0 ] )

引数

名前データ型デフォルト備考
$maxnumber0最大レコード数 / 0の場合はすべてのレコードを取得

Controller
$rss = $this->getClass('Tool/RSS', 'https://example.com/feed');
$posts = $rss->fetchAll(5);

foreach ($posts as $post) {
// $postを使用
echo $post['title'] . "\n";
echo $post['description'] . "\n";
echo $post['link'] . "\n";
}