PHP code example of nuages / rss-feed

1. Go to this page and download the library: Download nuages/rss-feed library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nuages / rss-feed example snippets



use RssFeed\RssFeed;
use RssFeed\RssItem;

$rss = new RssFeed();
$rss->title('Site Title')
    ->description('Site Description')
    ->link('http://example.com/')
    ->atomLink('http://example.com/rss.xml');

$item = new RssItem();
$item->title('Post 1')
    ->description('Your description here')
    ->link('http://example.com/1&test=123')
    ->guid('http://example.com/1')
    ->pubDate('2015-01-02 12:23:34');

$rss->addItem($item);
$rss->render();