php截取字符串,帶中文,多餘的省略號代替

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