title: PHP - get first two sentences of a text?
body: <p>My variable <code>$content</code> contains my text. I want to create an excerpt from <code>$content</code> and display the first sentence and if the sentence is shorter than 15 characters, I would like to display the second sentence.</p>
  
  <p>I've already tried stripping first 50 characters from the file, and it works:</p>
  
  <pre><code>&lt;?php echo substr($content, 0, 50); ?&gt;
  </code></pre>
  
  <p>But I'm not happy with results (I don't want any words to be cut).</p>
  
  <p>Is there a PHP function getting the whole words/sentences, not only substr?</p>
  
  <p>Thanks a lot!</p>