PHP code example of joelwmale / rss-feed-php

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

    

joelwmale / rss-feed-php example snippets


use joelwmale\RSSFeedPHP;

$feed = RSSFeedPHP::load($url);

echo 'Title: ', $feed->title;
echo 'Description: ', $feed->description;
echo 'Link: ', $feed->link;

foreach ($feed->item as $item) {
	echo 'Title: ', $item->title;
	echo 'Link: ', $item->link;
	echo 'Date: ', $item->date;
	echo 'Description ', $item->description;
	echo 'HTML encoded content: ', $item->{'content:encoded'};
}

use joelwmale\RSSFeedPHP;

$feed = RSSFeedPHP::load($url);
$feed->toArray();

use joelwmale\RSSFeedPHP;

RSSFeedPHP::$cacheDir = __DIR__ . '/tmp';
RSSFeedPHP::$cacheExpire = '5 hours';

composer