Create a PHP Rss Feed - Best Blogs Asia
Information on generating an RSS feed using the PHP programming language.
I’ve had this piece of code laying around for a while, it still works and is a very useful script to generate your own RSS feed.
Why an RSS Feed
It’s not required that every site has it. CMS sites like Wordpress automatically have it setup, whilst static HTML or custom coded sites do not. Offering a feed makes your site dynamic, so when new content is added – it’s automatically displayed on the feed. People can then download your feed and keep upto date with your site without having to visit it. It can also be a source of traffic, if you submit to RSS Submission sites.
PHP made RSS Feed
The source code below can be downloaded and integrated on your site. Any problems let me know here.
You would then integrate it using something like this, also using a Cron job to active it would help alot:
$myfeed = new RSSFeed();
$myfeed->SetChannel('http://www.mysite.com/xml.rss',
'My feed name',
'My feed description',
'en-us',
'My copyright text',
'me',
'my subject');
$myfeed->SetImage('http://www.mysite.com/mylogo.jpg');
$myfeed->SetItem('http://www.mysite.com/article.php?id=bla',
'name',
'description');
....
echo $myfeed->output();
No related posts.



