Ah, I whipped up a function for this a while ago. Check out the thread here and here's the function. Basicly, if the givin string is shorter then the max length it will return the string. If the givin string is longer than the max length it will look for the last whitespace and take everything before it. Then it'll tack on the givin ending (default is ...) and return it.
string str_shorten ( string text, int max_length[, string ending])
function str_shorten($str, $len, $end='...')
{
if ($len < strlen($str)) {
$cut = substr($str, 0, $len);
if ($str{$len} == ' ')
$short = $cut . $end;
elseif ($str{$len-1} == ' ')
$short = rtrim($cut) . $end;
elseif (($space = strrpos($cut, ' ')) !== false)
$short = substr($cut, 0, $space) . $end;
else
$short = $cut . $end;
} else
$short = $str;
return($short);
}