php截取字符串,带中文,多余的省略号代替

function subtext($text, $length) { if(mb_strlen($text, 'utf8') > $length) { return mb_substr($text, 0, $length, 'utf8').'...'; } else { return $text; } } $str = '咱们是famil
相关文章
相关标签/搜索