Building a Generic RSS Class With PHP (Page 1 of 6 )
It seems that every site provides an RSS XML feed these days -– even we do. But what is an RSS XML feed, why would you want to create one, and how the heck do you create one?
Well, in this article I'll attempt to answer all 3 questions for you, the intermediate PHP developer. In this article you will learn what RSS XML is and how to generate your own RSS XML file from a class that we will build in PHP. This class will connect to a database, grab the appropriate fields, and split out a nice RSS compatible XML file that you can share.
To implement the class that we will create, you need at least PHP v4.1 installed. Note that you don't need any sort of XML support enabled -- we will simply be using mysql_xxx functions and joining some strings together.
You will also need access to a MySQL database, which is where we will get the content to build our RSS XML data. I will assume that you have an intermedia knowledge of PHP, basic knowledge of XML, and no knowledge of the RSS standard.