Thursday, September 10, 2026 at 3:10 p.m.
I just found a simpler way to generate an RSS feed and modified my blogging software to use it :
<?php
header('Content-Type: application/rss+xml');
$rss = simplexml_load_string('<rss/>');
$rss['xmlns:content'] = 'http://purl.org/rss/1.0/modules/content/';
$rss['version'] = '2.0';
// Infos of the blog :
$channel = $rss->addChild('channel');
$channel->title = 'Title of the blog';
$channel->link = 'http://www.example.com/';
$channel->description = 'Description of the blog';
// Creating an article :
$item = $channel->addChild('item');
$item->link = 'http://www.example.com/article.html';
$item->guid = $item->link;
$item->guid['isPermaLink'] = 'true';
$item->pubDate = date(DATE_RSS);
$item->title = 'Title of the article';
$item->description = 'Summary of the article';
$item->{'content:encoded'} = '<p>Full content of the article</p>';
echo $rss->asXML();