Articles
Crop text without splitting words
- Details
- Published on Wednesday, 14 December 2011 10:07
An example of some code that crops text without stopping part way through a word.
$description = $crop_desc ?
implode(" ", array_slice (explode(" ", $details->Description),0, $crop_desc)).'...'.$morelink
: $details->Description;