PHP code example of lib16 / rss

1. Go to this page and download the library: Download lib16/rss 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/ */

    

lib16 / rss example snippets



Lib16\RSS\Channel;
use Lib16\RSS\RssMarkup;

$channel = Channel::create(
    'RSS Title',
    'This is an example of an RSS feed',
    'http://www.example.com/main.html'
);
$channel
    ->pubDate(new DateTime('2010-09-06 00:01 +0'))
    ->lastBuildDate(new DateTime('2009-09-06 16:20 +0'))
    ->ttl(1800);

$channel
    ->item(
        'Example entry',
        'Here is some text containing an interesting description.',
        'http://www.example.com/blog/post/1'
    )
    ->guid('7bd204c6-1655-4c27-aeee-53f933c5395f', false)
    ->pubDate(new DateTime('2009-09-06 16:20 +0'));

RssMarkup::headerfields('example');
print $channel;