function truncate($string, $length)
{
if (strlen($string) > $length) {
$string = substr($string, 0, $length) . '...';
}
return $string;
}
function truncate($string, $length)
{
if (mb_strlen($string) > $length) {
$string = mb_substr($string, 0, $length) . '...';
}
return $string;
}