PHP BSD-3-Clause

rss-php

Small and easy-to-use library for consuming RSS and Atom feeds

D

dg

Dernière activité 13 juil. 2026
dg/rss-php

483

étoiles

138

forks

7

issues ouvertes

phprss

Ce README est souvent en anglais.

RSS & Atom Feeds for PHP

Downloads this Month Latest Stable Version License

RSS & Atom Feeds for PHP is a very small and easy-to-use library for consuming an RSS and Atom feeds.

It requires PHP 5.3 or newer with CURL extension or enabled allow_url_fopen and is licensed under the New BSD License. You can obtain the latest version from our GitHub repository or install it via Composer:

composer require dg/rss-php

Do you like RSS? Are you looking forward to the new features?

Buy me a coffee

Thank you!

Usage

Download RSS feed from URL:

$rss = Feed::loadRss($url);

The returned properties are SimpleXMLElement objects. Extracting the information from the channel is easy:

echo 'Title: ', $rss->title;
echo 'Description: ', $rss->description;
echo 'Link: ', $rss->url;

foreach ($rss->item as $item) {
	echo 'Title: ', $item->title;
	echo 'Link: ', $item->url;
	echo 'Timestamp: ', $item->timestamp;
	echo 'Description ', $item->description;
	echo 'HTML encoded content: ', $item->{'content:encoded'};
}

Download Atom feed from URL:

$atom = Feed::loadAtom($url);

You can also enable caching:

Feed::$cacheDir = __DIR__ . '/tmp';
Feed::$cacheExpire = '5 hours';

You can setup a User-Agent if needed:

Feed::$userAgent = "FeedFetcher-Google; (+http://www.google.com/feedfetcher.html)";

If you like it, please make a donation now. Thank you!

Projets similaires

A simple Atom/RSS parsing library for PHP.

PHPatomlibraryparser
Ssimplepie
1,6 k étoiles396

A free, self-hostable news aggregator…

PHPfeedfreshrssnews-aggregator
FFreshRSS
16,2 k étoiles1,3 k

A free, flexible, open-source, web-based news feed (RSS/Atom/other) reader and aggregator.

PHPrssrss-aggregatorrss-generator
Ttt-rss
852 étoiles88