Script for reading all streams in PHP
This PHP script contains one function that can show any syndication stream in all formats. The file URL can be local, rss.xml, or remote https://www.iqlevsha.ru/rss.xml.
The script is compatible with:
- Atom 1.0
- RSS 2.0
- RSS 0.91, 0.92, 0.94
- RSS RDF 1.0
Interface
The interface includes one function:
Common_Display (url, size, channel-option, desc-option, date-option )The interface requires a required argument, url, and recognizes four additional arguments:
- url :
The address of the XML file on the network. - size:
Maximum number of items to display. 25 by default. - option channel:
true if the channel is displayed, false otherwise. The default value is true. - desc-option :
true if descriptions are otherwise displayed, or false. the default is true. - date variant:
true if dates are displayed or false otherwise. false by default.
How to show only a link on the site
To show only part references, replace in the function Common_Display this line:
last $ = array_slice ($ Common _ Content, 0, $ size);by:
last $ = array_slice ($ Common _ Content, 1, $ size);Download scripts and demos
- Common Reader. The script requires PHP 5.
- This includes the following demonstrations :
- - Show RSS/Atom/RDF feed directly.
- Use the form to define display settings.
Documentation
- How to build an RSS stream. Tutorial for which this script is an application. The script in the tutorial has been simplified in this version.