title: How to substr() string to certain length BUT untill last space?
body: <p>Assume we have a string <code>patterns also provide us a common vocabulary to describe solutions</code>.</p>
  
  <p>We <code>substr()</code> this string so we have <code>patterns also provide us a common vocabulary to desc</code>.</p>
  
  <p>How to cut last string to <code>patterns also provide us a common vocabulary to</code>?</p>
  
  <p>My way is:</p>
  
  <pre><code>$text = mb_substr($new['text'], 0, 100);
  
  if(mb_substr($text, -1) != ' ') {
  
      $text_expl = explode(' ', $text);
  
      $text = implode(' ', array_splice($text_expl, 0, -1)) . ' ...';
  
  }
  </code></pre>
  
  <p>Is there something nicer?</p>
  
  <p>Maybe regualr expression or some PHP built-in function can do something similar?</p>