return $text; | return $text; | ||||
} | } | ||||
public function limitTextByLength($text, $length) | |||||
{ | |||||
if(strlen($text) > $length) { | |||||
$text = substr($text, 0, $length).' ... ' ; | |||||
} | |||||
return $text ; | |||||
} | |||||
function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) | function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true) | ||||
{ | { | ||||
if ($considerHtml) { | if ($considerHtml) { |