Daily Shaarli

All links of one day in a single page.

May 15, 2017

RSS Reader - PHP script for displaying an RSS feed on a web page

How to display an RSS feed with a single PHP function? The URL of the file may be

There is only one difference, if the filename has the ".php" extension when it is generated by a CMS or such software, locally the file is processed by the server as a text file while remotely it is processed as a script. There is no difference if the extension is ".xml".

The script is compatible with:

  • RSS 2.0 (that is compatible with 0.91, 0.92 etc.)
  • RSS RDF or RSS 1.0.
    Actually the script extracts the title, link and description tags and ignores the format of structure of the document.
    The benefit of PHP to display an RSS feed is that it will be visible by search engines.