Creating XML-RSS Feed Using PHP MYSQL
Friday, June 11, 2010 5:04:31 PM
$h=utf8_encode(clean_url($result['name']));
$d=utf8_encode(clean_url($result['discription']));
I have attached PHP Source code for XML Generator
feed.php
Right click on the above link and save target as …
Below function is used to clean all extra characters in the content.
function clean_url($text)
{
$text=strtolower($text);
$code_entities_match = array(‘>>’,'–’,'�’,'–’,'&’,'“’,'”’,'–’,'’’,'-’,'–’,'”‘,’!',’@',’#',’$',’%',’^',’&’,'*’,'(‘,’)',’_',’+',’{‘,’}',’|',’:',’”‘,’< ‘,’>’,'?’,’[',']‘,’\\’,';’,”‘”,’,',’.',’/',’*',’+',’~',’`',’=',’-',’ï’,'–’,”‘”,’O');
return str_replace($code_entities_match,”, $text);
}
To make an rss feed you need title, description and link
Sample RSS FEED format
<rss version=”0.91″>
<channel>
<link>http://www.xml.com/</link>
<description>XML.com features a rich mix of information and services for the XML community.</description>
<language>en-us</language>
<item>
<link>http://www.xml.com/pub/a/2002/12/04/normalizing.html</link>
<description>In this second and final look at applying relational normalization techniques to W3C XML Schema data modeling, Will Provost discusses when not to normalize, the scope of uniqueness and the fourth and fifth normal forms.</description>
</item>
<item>
<link>http://www.xml.com/pub/a/2002/12/04/svg.html</link>
<description>In this month’s SVG column, Antoine Quint looks back at SVG’s journey through 2002 and looks forward to 2003.</description>
</item>
</channel>
</rss>
also go through the source code attached














Unregistered user # Tuesday, August 3, 2010 3:36:24 PM