PHP code example of vinelab / rss

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

    

vinelab / rss example snippets


$rss->feed('https://stackoverflow.com/feeds/tag?tagnames=php&amp;sort=newest');

$feed->info();
$feed->articles();



use Vinelab\Rss\Rss;

$rss = new Rss();
$feed = $rss->feed('https://stackoverflow.com/feeds/tag?tagnames=php&amp;sort=newest');

// $feed is now an instance of Vinelab\Rss\Feed

$info = $feed->info();
$count = $feed->articlesCount();
$articles = $feed->articles();

$info = $feed->info();

echo json_encode($info);

$articles = $feed->articles();

$article = $articles->first();

echo $article->title; // ABBA piano seen raising money, money, money at auction

echo $article->whatever; // null

foreach ($feed->articles() as $article) {
  $title = $article->title;
}

$article->xml();
 'MyRSS'    => 'Vinelab\Rss\Facades\RSS',
json
{
   "title": "Newest questions tagged php - Stack Overflow",
   "subtitle": "most recent 30 from stackoverflow.com",
   "updated": "2020-07-16T19:14:29Z",
   "id": "https://stackoverflow.com/feeds/tag?tagnames=php&sort=newest"
 }