Some would use ereg or some such, but this is much simpler: If you have a variable that has the text of your article, say, $text, you could do this:
$words = explode(" ",$text);
for($i = 0; $i < 30; $i++) {
$summary .= $words[$i] . " ";
}
$summary .= "...";
print($summary);