I want to limit the number of characters in a script output. To see what I mean, go here. The 4th title on the page needs to be trimmed, but I can't seem to find out how to do it. A little help would be appreciated
$max_chars = 40; if (strlen($title) > $max_chars) {$tok = strtok($title," ");$kim = $tok; if (strlen($kim) < ($max_chars-10)) {$tok = strtok(" ");$kim = $kim." ".$tok;}; if ($kim != "$title") {$kim.="...";}; $title = $kim;