$size) { $pos = ($trimAtSpace ? strrpos(substr($string, 0, $size), " ") : $size-3); return substr($string, 0, $pos) . "..."; } return $string; } ?>