Jacques Noah posted an article on the devshed about creating a PHP-based RSS reader on a platform built by PhP4 and any version of MySQL. The RSS document has three main labels: title, link, and description contain the same information as their names.
Jacques lists two pieces of code from an RSS document, including the start part and the end part, and describes the steps required before creating an RSS reader for PHP.
[Chinese webmaster site]
First, extract the content described by the label. A typical RSS document is structured as follows:
Chinaz.com
Reference content is as follows: <RSS> <Channel> <Item> </Item> </Channel> </RSS> |
A tag like <items> that does not contain "/" is the start tag, and a "</items>" that contains "/" is the end tag, therefore, the extracted content function should match the content of "<item> </items>" to obtain the specific content.
Chinaz.com
Jacques also discussed how to use the built-in functions provided by PHP to make the parsing documentation clearer and more convenient. After creating the necessary functions, Jacques uses function loops to extract and display the content in the XML file. Jacques also shows us how to get content from other sources when an RSS reader is unavailable. He created a database about RSS information and used the database to update RSS files, the data table and sample code of this database are provided.