<?
function cut_text( $text, $maxwords = 15, $maxchar = 100 ){
    $sep=' ';
    $sep2=' ....';
    $words = explode($sep,$text);
    $char = iconv_strlen($text,'utf-8');
    if (count($words) > $maxwords){        $text = join($sep, array_slice($words, 0, $maxwords));
    }
    if ( $char > $maxchar ){
        $text = iconv_substr( $text, 0, $maxchar, 'utf-8' );
    }
    return $text.$sep2;
}
?>