Originally Posted by enigma
$text = substr($title,0,100);
|
Note that substr() is not UTF-8 compatible and can screw up non-ascii characters. Instead use mb_substr().
And if you are interested in a function that will preserve full words, I created text::limit_chars() for Kohana long time ago:
http://dev.kohanaphp.com/browser/tru...p?rev=3366#L40