//超过长度时在尾处加上省略号
function cutstr($f_tempstr,$f_tempwid)
{
if(mb_strlen($f_tempstr,'utf-8')>$f_tempwid)
{
echo mb_substr($f_tempstr,0,$f_tempwid,'utf-8')."...";
}else{
echo $f_tempstr;
}
}
//超过长度时在尾处加上省略号
function cutstr($f_tempstr,$f_tempwid)
{
if(mb_strlen($f_tempstr,'utf-8')>$f_tempwid)
{
echo mb_substr($f_tempstr,0,$f_tempwid,'utf-8')."...";
}else{
echo $f_tempstr;
}
}
本文标题:超过长度在末尾加省略号
本文链接:https://www.haomeiwen.com/subject/fvdtsxtx.html
网友评论