This sample indicate how to read RSS news feed back using PHP
Sample Code
<?php require_once('rss/rss_fetch.inc'); error_reporting(E_ERROR); $rss = fetch_rss ( "http://www.youtube.com/rss/global/top_viewed_today.rss" ) ; $items = array_slice($rss->items, 0); $news_feed = ''; foreach ($items as $item ) { $news_feed .= '' . $item['title'] .'<br>'. $item['link'].'<br>'.$item['summary'] . '<br>' ; } echo $news_feed; ?> |
This sample uses MagpieRSS library which is attached with the source code and also can be downloaded from the following link
http://magpierss.sourceforge.net
No comments:
Post a Comment