Meaning of a simple pattern of preg_replace (#\s+#)?
<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="http://meta.stackoverflow.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="nofollow">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="nofollow">Pattern Syntax</a> &amp; <a href="http://php.net/manual/en/function.preg-replace.php" rel="nofollow">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="nofollow"><code>str_word_count</code></a> instead?</p>
