PHP RSS Generator: Generate a RSS feed with a fluent interface

Recommend this page to a friend!
  Info   Example   View files (17)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
47%Total: 166 All time: 8,661 This week: 355
Version License PHP version Categories
php-rss-generator 1.0.3Custom (specified...5XML, PHP 5
Description Author

This package can be used to generate a RSS feed with a fluent interface.

It provides several classes to compose several parts of the RSS feed like the feed, channel and items.

Items can be added to a channel and the channel can be added to a feed.

The composed RSS feed XML can be outputted in RSS 2.0 format.

Picture of Bhaktaraz Bhatta
Name: Bhaktaraz Bhatta <contact>
Classes: 1 package by
Country: Nepal Nepal
Age: 29
All time rank: 413010 in Nepal Nepal
Week rank: 762 3 in Nepal Nepal



\Bhaktaraz\RSSGenerator is RSS generator library for PHP 5.5 or later.

Scrutinizer Code Quality Build Status


You can install via Composer.

Add in your composer.json file:

	"require": {
		"bhaktaraz/php-rss-generator": "dev-master"

Run composer to install.

$ composer update

RSS Feed Implementation:

$feed = new Feed();

$channel = new Channel();
	->description("Programming with php")

// RSS item
$item = new Item();
	->description("It is not too easy to enhance the performance of your application. In Symfony2 you could get benefit from caching.")
	->enclosure('', 4889, 'audio/mpeg')

echo $feed;


<?xml version="1.0"?>
<rss version="2.0">
    <description>Programming with php</description>
      <title>CACHING DATA IN SYMFONY2</title>
      <description>It is not too easy to enhance the performance of your application. In Symfony2 you could get benefit from caching.</description>
      <enclosure url="" type="audio/mpeg" length="4889"/>

Facebook product feed implementation:

$feed = new Feed();

$channel = new Channel();
	->description("geekyrepo - for geeks by a geek")

// Product feed item
$item = new FacebookProductItem();
	->title("elePHPant Small")
	->description("elePHPant hand made in nepal.")
	->availability('in stock') 
	->googleProductCategory('Apparel & Accessories > Clothing > Underwear & Socks')

echo $feed;


<rss xmlns:content="" xmlns:dc="" xmlns:sy="" xmlns:g="" version="2.0">
<channel xmlns:g="">

	<item xmlns:g="">
		<g:id xmlns:g="">78</g:id>
		<g:title xmlns:g="">elePHPant Small</g:title>
		<g:link xmlns:g="">
		<g:description xmlns:g="">elePHPant hand made in nepal.</g:description>
		<g:availability xmlns:g="">in stock</g:availability>
		<g:price xmlns:g="">699 NPR</g:price>
		<g:condition xmlns:g="">new</g:condition>
		<g:google_product_category xmlns:g="">
		Apparel & Accessories > Clothing > Underwear & Socks
		<g:image_link xmlns:g="">
		<g:brand xmlns:g="">geekyrepo</g:brand>
		<g:custom_label_0 xmlns:g="">elephpant-small</g:custom_label_0>
		<g:custom_label_1 xmlns:g="">
		<g:custom_label_2 xmlns:g="">ELESM</g:custom_label_2>

File Role Description
Source (1 directory)
Tests (4 files)
.travis.yml Data Auxiliary data
composer.json Data Auxiliary data
example.php Example Example script
LICENSE Lic. License text Doc. Documentation

  Files  /  Source  
File Role Description
Bhaktaraz (1 directory)

  Files  /  Source  /  Bhaktaraz  
File Role Description
RSSGenerator (8 files)

  Files  /  Source  /  Bhaktaraz  /  RSSGenerator  
File Role Description
   Channel.php Class Class source
   ChannelInterface.php Class Class source
   FacebookProductItem.php Class Class source
   Feed.php Class Class source
   FeedInterface.php Class Class source
   Item.php Class Class source
   ItemInterface.php Class Class source
   SimpleXMLElement.php Class Class source

  Files  /  Tests  
File Role Description
   Bootstrap.php Aux. Auxiliary script
   composer.json Data Auxiliary data
   phpunit.xml.dist Data Auxiliary data Doc. Documentation

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:8,661
This week:355
 User Ratings  
 All time

For more information send a message to info at phpclasses dot org.