Forum Moderators: coopster
Example :
The quick brown fox jump over the lazy dog Getting the 1st 22 characters will display
The quick brown fox j... But I want to always display the full last word
The quick brown fox jump... How can I do that?
Thanks!
$str = "The quick brown fox jump over the lazy dog ";
$i = 0; $count = 0;
$exp = explode(" ", $str);
while ($count < 18) {
$an_val = $exp[$i];
$output .= $exp[$i] ." ";
$count = $count + strlen($an_val);
$i++;
}
echo $output;
But again, there is always better way of doing things.
Habtom