PHP RSS Reader

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
RobbieL
Forum Commoner
Posts: 31
Joined: Fri Mar 23, 2007 5:57 pm

PHP RSS Reader

Post by RobbieL »

Working a little project, and want to include the ability for users to add RSS feeds to a particular page. I've never used XML with PHP, so had a quick Google to see how things are done. So far I've come across 3 ways of apparently getting it done, and they all look pretty different to one another. Using PHP's built in XML functions, SimpleXML or cURL (with what looks like SimpleXML).

Is there any benefit to using a particular method? I actually went ahead and created what I was needing using PHP's built in XML functions, but having a right bother getting it to only display the last 5 feeds and not the entire feed, so was wondering if the other 2 methods makes things a little less hassle free.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: PHP RSS Reader

Post by pickle »

Of those three methods, SimpleXML is your best bet. It is quite a bit simpler than the other two methods. If those don't work, maybe look at a third party library such as magpieRSS or SimplePie (my personal favourite).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
RobbieL
Forum Commoner
Posts: 31
Joined: Fri Mar 23, 2007 5:57 pm

Re: PHP RSS Reader

Post by RobbieL »

Cheers Pickle. Had a quick look at SimpleXML, and you're definitely right, it is a lot simpler to get done. Thanks again. :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: PHP RSS Reader

Post by Chris Corbyn »

SimplePie. It's Magpie, but better ;)
Post Reply