src/Core/Helper.php
public static function subStr($str, $len, $enc = 'utf8')
    {
        if (self::strLen($str) > $len) {
            return mb_substr($str, 0, $len, $enc) . '...';
        } else {
            return $str;
        }
    }
public static function subStr($str, $len, $enc = 'utf8')
    {
        if (self::strLen($str) > $len) {
            return mb_substr($str, 0, $len, $enc) . '...';
        } else {
            return $str;
        }
    }
截取字符串

@param string $str 要截取的字符串参数
@param string $len 截取的长度
@param string $enc 字符串编码
@return string