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}
Limit Word Size in String
Moderator: General Moderators
Re: Limit Word Size in String
Explode on space and loop through the resulting array?
Re: Limit Word Size in String
Thank you; I have it working nicely now.