A downloadable file is available for this article. As an extra I will introduce a database aspect of the reader. We will use the database to store and retrieve the latest stories. To continue with this article you will need PHP 4 and higher and optionally MYSQL. Below is an example text from an RSS document: Start example text <item> <title>First example</title> <link>www.mylink.com/someplace.html</link> <description>Some description, blah,blah,blah </item> <item> <title>Thousands set to attend todays celebration</title> <link>http:// <description>blah,blah,blah </description> </item> End example text Code To create an RSS Reader in PHP, we need to:
A typical RSS document will have the following structure: <RSS> <channel> <item> </item> </channel> </RSS> A start tag is a tag without the “/” character, for example: <items>. An end tag is a tag with the “/” character, for example: </item>. So the start and end tag functions will search for the “<item></item>” tags and once they have found those, it will be a simple matter of retrieving the text data from them to display.
blog comments powered by Disqus |
|
|
|
|
|
|
|