Proofing (fixing punctuation, spaces, uppercase letters) a bio page text with php
<p>I need help in trimming the bio info users submit inside their profiles.
Sometimes there are proofing problems:
"This is the bio OF Mike, OF being uppercase with no reason!there is no space between question mark and the word there?also the question mar should have a space.also after the stop sign there should be upper case,and spaces between this commas,and,this,one"</p>

<p>Here is what I am thinking:</p>

<p>First I'd trim $bio var</p>

<pre><code>$bio = trim($bio); 
</code></pre>

<p>Then I'd add spaces after punctuation marks - pretty sure this is not correct because it replaces every punctuation type with a comma.</p>

<pre><code>$bio = str_replace(array(",","!","?"),", ", $bio); 
</code></pre>

<p>Then I'd turn all the letters to lowercase; which won't work becouse I need to keep the uppercase for the first letter of the first word of the sentences inside the $bio variables.</p>

<pre><code>$bio = strtolower($bio); 
</code></pre>

<p>And finally I'd upper case the first one; but I need a way to upper case each first letter of every word separated by ! ? - or stop sign, you know... except commas.</p>

<pre><code>$bio = strtoupper($bio); 
</code></pre>

<p>Hope you can help</p>
