src/Core/Helper.php
public static function subStrHTML($str, $len, $enc = 'utf8')
    {
        $str = self::subStr($str, $len, $enc);
        return self::formatHTMLString($str);
    }
public static function subStrHTML($str, $len, $enc = 'utf8')
    {
        $str = self::subStr($str, $len, $enc);
        return self::formatHTMLString($str);
    }
安全的截取HTML字符串

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