Create a PHP Rss Feed

  • Share this Post on Digg
  • Share this Post on Twitter
  • Share this Post on Design Float
  • Share this Post on Delicious

Mar 29th, 2010 Web Development 0 Comment

Stumble Create a PHP Rss Feed

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.

Leave a Reply to "Create a PHP Rss Feed"

Have an Avatar? - Register one now!
Liked the post? - Subscribe via RSS.

Copyright 2008 - 2012 | Best Blogs Asia