You should search for any delimiters (.?!) With strpos() and find the position of the first occurrence. Thereafter:
$first_sentence = substr($your_sentence, 0, $first_occurance+1);
Edit: You should take precautions when there is no delimiter by setting the default maximum length to show:
$max_length = 40; $stop = $first_occurance > $max_length ? $max_length : $first_occurance + 1; $first_sentence = substr($your_sentence, 0, $stop);
source share