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
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