Limit Word Size in String
Posted: Fri Dec 09, 2011 7:38 pm
How can I check each word in a string of text for the length of each word and edit the string if a word is too long?
For example
$string = "supercalifragilisticexpialidocious of course if you say it backwards it would be Suoicodilaipxecitsiligarfilacrepus"
$string = no_long_words($string, 11); //($string, $maxlen)
echo $string; > {lenEx} of course if you say it backwards it would be {lenEx}
For example
$string = "supercalifragilisticexpialidocious of course if you say it backwards it would be Suoicodilaipxecitsiligarfilacrepus"
$string = no_long_words($string, 11); //($string, $maxlen)
echo $string; > {lenEx} of course if you say it backwards it would be {lenEx}