Hallo,
I'm sure that this has been covered somewhere and I spent about 30 minutes trying to find the solution, but...
What I have is a list of events, and all the events have a description (way longer than 200 characters). What I want to do is list all events on one page and show first 100 chars of the description. Simple:
$description =substr($description, 0, 100);
does the job. But what I'd like to have is the modified version of that, this means that it would not cut the words in the middle. This means, if the description would have a space between two words at character 97 and then at character 104, I'd like to have only first 97 characters returned and displayed.
I'm not sure if substr function is the best thing to use for that... perhaps I should turn to those ereg etc. functions?
TIA,
Kristjan