Truncation on the server-side is unnecessary, complicated, and usually confusing to the user. Luckily, CSS offers a combination of properties to truncate strings and add ellipsis… on the client-side, without JavaScript…
Direct link: CSS String Truncation with Ellipsis