|
@@ -135,7 +135,11 @@ function jsonError($msg, $data = [])
|
|
|
|
|
|
function subtext($text, $length)
|
|
|
{
|
|
|
+ //去除标签 空格 换行等空白字符
|
|
|
$text = strip_tags($text);
|
|
|
+ $search = array(" ", " ", "\n", "\r", "\t");
|
|
|
+ $replace = array("", "", "", "", "");
|
|
|
+ $text = str_replace($search, $replace, $text);
|
|
|
if (mb_strlen($text, 'utf8') > $length) {
|
|
|
return mb_substr($text, 0, $length - 1, 'utf8') . '...';
|
|
|
} else {
|