PHP code example of channaveer / rss

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

    

channaveer / rss example snippets



use Channaveer\RSS\RSS;

title'         => 'What Is Composer? How Does It Work? Useful Composer Commands And Usage',
        'url'           => 'https://somesite.in/posts/what-is-composer-how-does-it-work',
        'description'   => 'In this article, you will learn: What Is Composer, Using Composer, Installation In Ubuntu/Windows/Mac.',
        'updatedAt'     => '2020-05-07'
    ]
];

$path       = '.'; /** Path to generate your rss.xml file */
$filename   = 'rss.xml'; /** RSS filename default is rss.xml  */
$rss        = new RSS();

$rss->siteName('SiteName')
    ->siteUrl('https://siteurl.com')
    ->description('Some random description of the site')
    ->language('en-US') /** Default is en-Us you can set any of yours */
    ->lastUpdated($feedItems[0]['updatedAt']) /** Just pass datetime string or date string */
    ->generate($path, $rssItems, $filename);