I was add a little tricky for bechster code :
<?php
function string_limit_words($string, $word_limit)
{
$words = explode(' ', $string, ($word_limit + 1));
if(count($words) > $word_limit) {
array_pop($words);
//add a ... at last article when more than limit word count
echo implode(' ', $words)."..."; } else {
//otherwise
echo implode(' ', $words); }
}
?>
So, when your word count more than a limit, you get a … at last article.
Hope it’s usefull.