title: Meaning of a simple pattern of preg_replace (#\s+#)?
body: <p>Sorry for the very basic question, but <em>there's simply no easy way to search for a string like that</em> <a href="https://meta.stackexchange.com/questions/32879/is-it-possible-to-search-for-punctuation-special-characters">nor here</a> neither in Google or <a href="http://www.symbolhound.com/" rel="noreferrer">SymbolHound</a>. Also haven't found an answer in PHP Manual (<a href="http://de3.php.net/manual/en/reference.pcre.pattern.syntax.php" rel="noreferrer">Pattern Syntax</a> &amp; <a href="http://php.net/manual/en/function.preg-replace.php" rel="noreferrer">preg_replace</a>).</p>
  
  <p>This code is inside a function that receives the <code>$content</code> and <code>$length</code> parameters.<br>
  What does that <code>preg_replace</code> serves for?</p>
  
  <pre><code>$the_string = preg_replace('#\s+#', ' ', $content);
  $words = explode(' ', $the_string);
  
  if( count($words) &lt;= $length ) 
  </code></pre>
  
  <p>Also, would it be better to use <a href="http://php.net/manual/en/function.str-word-count.php" rel="noreferrer"><code>str_word_count</code></a> instead?</p>