title: This regex is cutting off the last word in the string even though strlen is within acceptable range
body: <pre><code>$theExcerpt = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis'
  
  $theExcerptAppend = (strlen($theExcerpt) &gt; 156) ? '...' : '';
  $theExcerpt = preg_replace('/\s+?(\S+)?$/', '', substr($theExcerpt, 0, 156));
  $theExcerpt .= $theExcerptAppend;
  </code></pre>
  
  <p>As long as the input phrase length exceeds 156 characters, the script works fine. However, when the length is less than 156 (as it is here at 154), the last word in being dropped off, even if the string, including the word, is still less than 156.</p>
  
  <p><strong>Note</strong>: I don't want the string to terminate in the middle of a word, but if the inclusion of the word does not exceed the strlen value of 156, it should be included.</p>