Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tektonnic

macrumors 6502
Original poster
Mar 6, 2006
336
0
Bucks, UK
Hi All,

I need some help with an rss stream I am creating, I want the description to only be 20 chars long and then ..., ie.

"abs sdf ffds gfrsd gfsdfe..."

Currently my RSS text is as follows;


while($sql = mysql_fetch_object($res))
{
$id = stripslashes($sql->id);
$title = stripslashes($sql->title);
$duration = stripslashes($sql->duration);
$reference = stripslashes($sql->reference);
$description = htmlspecialchars($sql->description);
echo "<item>\n";
echo "<title>".$title."</title>\n";
echo "<description>".$description."</description>\n";
echo "<duration>".$duration."</duration>\n";
echo "<reference>".$reference."</reference>\n";
echo "</item>\n";
}


So what can I do to make the description shorter?

Thanks, Tek
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.