Posted By

gokay1977 on 09/05/13


Tagged

rss xml read


Versions (?)

xml rss read


 / Published in: PHP
 

xml rss read

  1. <?php
  2. $html = "";
  3. $url = "http://www.developphp.com/feed_latest_texttuts.php";
  4. $xml = simplexml_load_file($url);
  5. for($i = 0; $i < 10; $i++){
  6. $title = $xml->channel->item[$i]->title;
  7. $link = $xml->channel->item[$i]->link;
  8. $description = $xml->channel->item[$i]->description;
  9. $pubDate = $xml->channel->item[$i]->pubDate;
  10. $html .= "<a href='$link'><h3>$title</h3></a>";
  11. $html .= "$description";
  12. $html .= "<br />$pubDate<hr />";
  13. }
  14. echo $html;
  15. ?>

Report this snippet  

You need to login to post a comment.