PHP Ucwords on underscores
<p>Just curious if anyone knows a quick way to use ucwords() on a string replacining
underscores with spaces? I have a preg_replace that will do it, but won't add the 
needed spaces in between...</p>

<pre><code>// this_string_contents -&gt; ThisStringContents
preg_replace('/(?:^|_)(.?)/e',"strtoupper('$1')",$string); 
</code></pre>

<p>And the reverse</p>

<pre><code>// ThisStringContents -&gt; this_string_contents
strtolower(preg_replace('/([^A-Z])([A-Z])/', "$1_$2", $string)); 
</code></pre>

<p>It would be nice if these were symmetrical too, the above
will do something like this</p>

<pre><code>* this_is_a_string -&gt; ThisIsAString -&gt; this_is_astring
* GetURLForString -&gt; get_urlfor_string -&gt; GetUrlforString
</code></pre>
