If you want to count it by word, you can just explode it on the space and print out the number of words you want...
$fullText="This is the full text that I am going to summarize so that it only prints out part of it, broken up by words.";
//
$allWords=explode(" ",$fullText);
$numberOfWords=5;
//
for($i=0;$i<$numberOfWords;$i++){
print("$allWords[$i] ");
}
But, you might end up with some summaries that are waaaay longer than others because they have bigger words. I prefer to do it by the number of characters and then break it off at the word...
$fullText="This is the full text that I am going to summarize so that it only prints out part of it, broken up by words.";
//
$chars = 30;
$summary = ereg_replace("^(.{1,$chars})[ .,].*","\\1", $fullText);
//
print("$summary");