libfeedphp is a simple, easy-to-integrate library providing support for RSS (0.91 and 2.0), Atom (0.3 and 1.0), and plain text feeds. It is designed to be as easy to use and as standards-compliant as possible.
BSD 2-clause
/* First, we create an article. */
$title = "Some Title";
$date = time();
$body = "This is the body of the article.";
$url = "http://www.example.com/article-url";
$article = new \feedphp\Article($title, $date, $body, $url);
/* Then we create a feed. */
$feed_title = "My Feed";
$feed_url = "http://www.example.com/feed.rss";
$feed_description = "This is the description of my feed.";
$feed = new \feedphp\RSS($feed_title, $feed_url, $feed_description);
/* Add the article to the feed. */
$feed->addArticle($article);
/* And we're done! */
echo $feed->output();
/* Or we could output a completely different version of RSS... */
echo $feed->output(RSS::VERSION_RSS_20); /* RSS 2.0 */