PHP生成RSS类 (PHP)
查看全部代码PHP生成RSS类
使用:
include_once('Rss.class.php');
$rss = new UniversalFeedCreator();
$rss->title = "PHP开源项目";
$rss->link = "http://www.coderhome.net";
$rss->description = "最全最新最丰富的PHP开源项目";
$softList = $query->select('select * from soft_list where status=1 order by id desc','array',1,100);
foreach ($softList as $rs) {
$item = new FeedItem();
$item->title = $rs['title'];
$item->link = 'http://www.coderhome.net/?id='.$rs['id'];
$item->description = $rs['content'];
$rss->addItem($item);
}
$rss->saveFeed("RSS2.0", "rss.xml");
Complete thread:
- PHP生成RSS类 - dzjzmj, 2008-06-21, 13:32
(PHP)