Jump to content

Parsing XML with PHP


mufonix

Recommended Posts

Hey. I apologize in advance for being a complete noob. I am building a web page for work (with very little knowledge of how to build web pages) and I would like to add the top three news headlines from our rss feed to the homepage in the "what's new" section. (see: http://www.accwt.org/newsite2/blank.html)I downloaded rss2html from rss2html.com but as far as I can tell it can't be used to parse news headlines and insert them into your own website. Does anyone know of any resources where I might be able to learn how to do this?

Link to comment
Share on other sites

The W3Schools' PHP tutorial is a good place to learn PHP. If you understand that, you could go on to using PHP's XML classes, as RSS is based on XML. DOM is the most powerful one, but as a start, you might try using SimpleXML instead. Don't forget to check up the respective DOM and SimpleXML references from the PHP manual, one you undestand the basic principles.Important: in order to understand either of the XML classes, you should have a basic understanding of XML first. DOM knowledge is kind'a required for the DOM class and is a plus for the SimpleXML class. If you learn XPath, you'll be able to get the most of both classes, but that's not so critical at this point.

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...