http://www.alfasky.com/?p=20
This little function will help you truncate a string to a specified
length when copying data to a place where you can only store or display
a limited number of characters, then it will append “…” to it showing
that some characters were removed from the original entry.
public static addEllipsis ( $string, $length, string $end = '...' ) : string | ||
$string | ||
$length | ||
$end | string | |
return | string |