function cSubStr( $str, $len, $flag = true)
{
    if(mb_strlen($str) < $len) return $str;
    $i = 0;
    $tlen = 0;
    $tstr = '';
    while ( $tlen < $len )
    {
        $tlen++;
        $chr = mb_substr( $str, $i, 1, 'utf8' );
        if ( $tlen > $len ) break;
        $tstr .= $chr;
        $i++;
    }
    if ( $tstr != $str && $flag )
    {
        $tstr .= '...';
    }
    return $tstr;
}