php 截取一段文字的前20字符

$tmp = strip_tags($model->content);
$temLen = mb_strlen($tmp);
return mb_substr($tmp,0,20,'utf-8').(($temLen>20)?'...':"");
原文地址:https://www.cnblogs.com/gaogaoxingxing/p/12743499.html