« Data Types in PHP
Generate Numbers in PHP »


rss feed to html

Posted by chaabant on Jan 1, 2008

This post is about how to take rss feeds and convert it to HTML for display issues .

Note : This is a basic methods , but the aim of it could be for affiliate marketing , anyone could take this and convert it to an ebay store using his affiliate id .

Since the rss feed is always updated , the site will update it self .

so here is the source code for it :

  1. <?php
  2.  
  3. $url = "http://www.chaaban.info/?feed=rss"; // url feed of my blog , it’s just an wordpress xml file …
  4.  
  5. $xml = new SimpleXMLElement($url, null, true);
  6.  
  7.  
  8. foreach($xml->channel->item as $itm){
  9.  
  10. echo "<a href=\"$itm->link\"> $itm->title </a> ";
  11. echo "<br />";
  12. }
  13.  
  14. ?>
Leave a Reply

You must be logged in to post a comment.