limitChars($text, $max)
$text : supplied text string
$max : adjusted maximum number of characters to return.
$text = 'This is a string of not more than 10 texts';
$text = limitChars($text, 22);
var_dump( $text );
This is a string of not...
of no..., however, due to
some little internal adjustments, the limitChars() function will smartly
adjust the last character to find a form of meaning. This is the reason why the last character t
was appended to form of not.... This behaviour is not predictable but it is majorly determined based
on the number of characters left to form a word.