Super simple way to display RSS feeds links on any php apge.

This was just way too simple and I had to share. (or keep it for later use.)

<ul><?php
$post = new SimpleXMLElement('XXX_URL_HERE_XXX',NULL,TRUE);
for ($i=0; $i<5; $i++) {
print('<li><a href="'. $post->channel->item[$i]->link . '">' . $post->channel->item[$i]->title . '</a></li>');
}
?></ul>

Link to SimpleXMLElement page on php.net.
For trouble shooting, try var_dump($post->channel); etc.

(Disclaimer: I will not be responsible for what this does. I am a php hack and no expert… Use with your own risk, please.)

Related posts:

  1. Very simple php snippet
  2. MySQL data format to display format in PHP
  3. PHP memo to myself
  4. Very Basic PHP
  5. MySQL PHP example
This entry was posted in Web/Print Design and Dev. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Welcome to Daigo’s Daily Digital Diorama. I blog about... whatever that comes to my mind.
  • Change color

    Purple Red Green Blue No Style

  • Archives

  • Calendar

    December 2009
    M T W T F S S
    « Oct   Jan »
     123456
    78910111213
    14151617181920
    21222324252627
    28293031  
  • Categories