limitWord($text, $max)
$text : supplied text string
$max : adjusted maximum number of characters to return.
4 is supplied on a string, the maximum acceptable number of
character will be 9 (i.e 4+5) due to an adjusted 5 character increase added by default. Hence, the
limitWord() function will assume that a maximum number of "9" characters is expected to be returned.
This means that any text after a character length 9 will be truncated. However, the limitWord also
projects that each word should never be broken apart. In the event that the last word was broken due to longer length,
then limitChar() will also truncate the last word so as to avoid breaking it apart
$text = 'This is a string of not more than 10 words';
$text = limitWord($text, 8); // max 13 (i.e 8+5)
var_dump( $text );
This is a str...
limitWord() does not support breaking words apart. Due to this reason, the last word "str" that was
split from "string" will also be truncated. Hence the final result will be :
This is a ...