this should help
<?
function limit_text( $text, $limit )
{
// figure out the total length of the string
if( strlen($text)>$limit )
{
# cut the text
$text = substr( $text,0,$limit );
# lose any incomplete word at the end
$text = substr( $text,0,-(strlen(strrchr($text,' '))) );
}
// return the processed string
return $text;
}
//Shrink string longer than 30 chrs
$shrink = limit_text($string_here, 30)
?>