<?php 
include ('associates/syfconnect.php');
$sql = "SELECT * FROM features WHERE ccode = 'uk' AND active = 'true' ORDER BY id DESC LIMIT 0,20";
$localresult = mysql_query("$sql",$db);
$localrow = @mysql_fetch_array($localresult);

// Do header
echo '<?xml version="1.0" ?>';
?>
<rss version="0.91">

<channel>
<title>Franchise Opportunities News</title>
<description>An overview of the latest franchises that have arrived on our site this month</description>
<link>http://www.selectyourfranchise.com</link>
<?php

// Do items

do
{
$title = $localrow["pagetitle"];
$introtext = strip_tags($localrow["bodytext"]);
$introtext = substr($introtext, 0, 125);
$introtext = $introtext ."...";

$introtext = (str_replace("&pound;","",$introtext));
$introtext = (str_replace("&quot;"," ",$introtext));
$introtext = (str_replace("&nbsp;"," ",$introtext));
$introtext = (str_replace("&rsquo;","",$introtext));
$introtext = (str_replace("&lsquo;","",$introtext));
$introtext = (str_replace("&ndash;","",$introtext));
$introtext = (str_replace("&amp;","",$introtext));
$introtext = (str_replace("&rdquo;","",$introtext));
$introtext = (str_replace("&hellip;"," ",$introtext));
$introtext = (str_replace("&ldquo;","",$introtext));
$introtext = (str_replace("&reg;","",$introtext));

$articlelink = (str_replace(" ","-",$localrow["pagetitle"]));

echo "<item>\n";
echo "<title>$title</title>\n";
echo "<description>$introtext</description>\n";
echo "<link>http://www.selectyourfranchise.com/uk/franchise-features/$articlelink.html</link>\n";
echo "</item>\n";
}
while ($localrow = @mysql_fetch_array($localresult));

// Do Footer
?>
</channel>
</rss>

