function titleResize($titleText) {
$maxLength = 15; ## the maximum length of a word is 20 characters
$newText = "";
$titleText = $titleText;
$titleWords = explode(" ",$titleText);
for ($i=0; $i<count($titleWords); $i++) {
if (strlen($titleWords[$i])>$maxLength)
$newText .= substr($titleWords[$i],0,$maxLength-3)."... ";
else $newText .= $titleWords[$i]." ";
}
return $newText;
}
Added by roScripts on April-18-2007, 3:53 pm
