PHP - How to Read RSS
Here's an example of how easy it is to parse RSS feeds using SimpleXML. This particular code reads the RSS of the upcoming Marakana public courses. You can use it on your website.
<?php
// The List of Public Courses across all Locations
$feed = simplexml_load_file( "http://marakana.com/training/schedule.rss" );
foreach( $feed->channel->item as $item ) {
echo '<a href="', $item->link, '">', $item->title, "</a><br/>\n";
}
?>
// The List of Public Courses across all Locations
$feed = simplexml_load_file( "http://marakana.com/training/schedule.rss" );
foreach( $feed->channel->item as $item ) {
echo '<a href="', $item->link, '">', $item->title, "</a><br/>\n";
}
?>
Go ahead, try it!
Marko
September 21st, 2007 at 8:47 am
When i copied your code the syntax was all wrong… the commas should be dots and the apostrophes I also had to correct.