XML Entities

webmasterbeta

New Member
Ok, so I'm working on my rss feed.

Here's the code:


<?php

header("Content-type: text/xml");

include("king/variables.inc");

echo("<rss version=\"2.0\"><channel>");
echo("<title>Summel</title>");
echo("<link>http://www.summel.net/</link>");
echo("<description>...everything you could ask for in nothing...</description>");
echo("<copyright>Copyright 2005 Summel.Net</copyright>");
echo("<language>en-us</language>");



$results = mysql_query("SELECT * FROM `king_news` ORDER BY `news_date` DESC LIMIT 10");

while($r = mysql_fetch_array($results))
{
echo("<item>");
echo("<title>" . stripslashes($r["title"]) . "</title>");
echo("<description>" . stripslashes($r["article_preview"]) . "</description>");
echo("<pubDate>" . date("D, d M Y H:i:s \C\D\T", $r["news_date"] - 3600) . "</pubDate>");
echo("<link>http://www.summel.net/article.php?id=" . $r["id"] . "</link>");
echo("</item>");
}

echo("</channel>");
echo("</rss>");

?>


Ok, if I validate it, it says that those stupid question marks that appear...shouldn't appear. They take the place of single or double-quotes.

Here's a link to the feed so you can see it in action:
<!-- m --><a class="postlink" href="http://www.summel.net/rss.php">http://www.summel.net/rss.php</a><!-- m -->

What can I do to get those to show up correctly so it'll validate?

I was thinking something similar to htmlentities() but...I dunno, I'm probably wrong.

Thanks for your time, :)
 
Back
Top