helpers/KatoBase.php
public static function limit_words($string, $word_limit)
    {
        $words = explode(' ',$string);
        return trim(implode(' ', array_splice($words, 0, $word_limit))) .'...';
    }
public static function limit_words($string, $word_limit)
    {
        $words = explode(' ',$string);
        return trim(implode(' ', array_splice($words, 0, $word_limit))) .'...';
    }
Helper function to limit the words in a string

@param string $string the given string
@param int $word_limit the number of words to limit to
@return string the limited string