SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot JarretCade's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XML & PHP Parsing

    Ok, so I followed the article here on sitepoint dealing with parsing XML in PHP.

    I got everything working ok except for the changes that I want done and being new to php I can't seem to figure out how to make it work the way I want.

    Basically, I want the script to read the file(which it does) except I only want it to read the first "link" in the rss feed.

    Also, I want it to read multiple rss feeds yet still only retrieve the first "article" from the rss feed.

    Basically what I'm trying to do is setup a Latest News box on my site, and I would like to have ~5 links in it reading from 5 different rss feeds.

    If somebody could point me in a direction as to how I would go about doing all this, I would be more then grateful. I would prefer not the code itself, I'm looking for more of a tutorial on how to do it so that I can learn how to do instead of using copy and paste and not learning how to do it.

  2. #2
    An average geek earl-grey's Avatar
    Join Date
    Mar 2005
    Location
    Ukraine
    Posts
    1,403
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would suggest you looking into SimpleXML / DOM functions instead of using an event-based API.

    In that case XML manipulation will be much like reading data from an array.

  3. #3
    SitePoint Zealot JarretCade's Avatar
    Join Date
    Aug 2007
    Location
    California
    Posts
    161
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright, I had already been digging into the SimpleXML a little bit while posting this.

    Any other ideas that come to mind?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •