magpierss RSS feed display example


/ Published in: PHP
Save to your folder(s)

for full html content: $content = $item['content']['encoded'];


Copy this code and paste it in your HTML
  1. <?php
  2. require_once('magpierss/rss_fetch.inc');
  3. $rss = fetch_rss('http://www.newsforge.com/index.rss');
  4.  
  5. echo "<a href=".$rss->channel['link']."><B>".$rss->channel[ 'title']."</B></a>";
  6. foreach ($rss->items as $item) {
  7. $href = $item['link'];
  8. $title = $item['title'];
  9. $desc = $item['description'];
  10. echo "<P><a href=$href>$title</a><BR>";
  11. if($desc)
  12. echo $desc;
  13. }
  14. ?>

URL: http://programming.linux.com/article.pl?sid=05/05/24/1337210

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.