sotusotusotu Posted April 18, 2008 Share Posted April 18, 2008 Hi guys, Hopefully someone who has had this problem can answer me. I have created an small app that loops through a field in a database to show the 15 latest news stories. This all works fine and displays most of the time. The problem that I am having is that the news stories are entered through fckeditor (text editor) and this includes HTML and unwanted characters. strip_tags solves most of the problems (between "<" and ">" tags), however I am still getting things like " in my RSS feed and it is throwing it. Does anyone have any ideas? <?php while ($value = mysql_fetch_array($result)){ echo "<item>"; echo "<title>".strip_tags(stripslashes(clean_up_text($value['headline'])))."</title>"; echo "<description>".strip_tags(c$value['summary'])."</description>"; echo "<link>news.php?id=".$value['article_id']."</link>"; echo "<guid>news.php?id=".$value['article_id']."</guid>"; echo "<pubDate>".date("r", strtotime($value["date_added"]))."</pubDate>"; echo "</item>"; } echo "</channel>"; echo "</rss>"; ?> Thanks, Andy Quote Link to comment https://forums.phpfreaks.com/topic/101717-unwanted-characters-in-rss/ Share on other sites More sharing options...
Daniel0 Posted April 18, 2008 Share Posted April 18, 2008 Why would you remove the entities? You can use html_entity_decode() if you want to though. Quote Link to comment https://forums.phpfreaks.com/topic/101717-unwanted-characters-in-rss/#findComment-520432 Share on other sites More sharing options...
sotusotusotu Posted April 18, 2008 Author Share Posted April 18, 2008 I'm not sure if I have explained myself properly. Or I'm not understanding your answer. I am trying to create a valid RSS. I am getting the data from a field in my db that has been written using an online text editor. This editor is adding HTML and characters such as " in stead of "" for example. My understanding of valid RSS feeds is that characters such as " are illegal and therefore make the RSS unvalid. So basically I am wondering if you know a way to check data coming out of the DB so it writes it in valid RSS? I hope this makes sense. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/101717-unwanted-characters-in-rss/#findComment-520460 Share on other sites More sharing options...
Daniel0 Posted April 18, 2008 Share Posted April 18, 2008 Try to post some sample data from your database. Quote Link to comment https://forums.phpfreaks.com/topic/101717-unwanted-characters-in-rss/#findComment-520514 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.