Very Simple PHP5 RSS Feed Reader.

Discussion in 'XML & RSS' started by philej, Dec 7, 2005.

  1. #1
    I was playing with RSS feeds in PHP5 and found this to be very cool. :)

    This simple function will print out a linked title for every item in your feed.

    
    // $location = URL of feed. 
    function load_xml_feed($location)
    {
        $feedXml = simplexml_load_file($location); 
        foreach ($feedXml->channel->item as $article)
        {
           print '<a href="' . (string)$article->link . '">' . (string)$article->title . '</a><br>'; 
        } 
    }
    
    Code (markup):
     
    philej, Dec 7, 2005 IP
  2. ciwee

    ciwee Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I found your post at google.com man
    exactly what I was searching for
    Cheers.
     
    ciwee, Nov 24, 2006 IP
  3. ciwee

    ciwee Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Actually I thought it was a PHP5 native method! what library should I download to use it
     
    ciwee, Nov 24, 2006 IP