Anyone know an elegant function to fix name cases?
<p>Kindergarten 101 teaches some of us that: "The letters in your name should be lowercase, with uppercase first letters." Yet in this post-literate era, how people enter their names in web forms seems to depend on their mood, or solar flares or whatnot: All uppercase, all lowercase, mixed, upside down...</p>

<p>Philosophically, I say whatever! Occupy your name, who cares. But I have OCD clients that prefer to see data normalized, standardized, predictable. So I'm asking you guys if you've seen any well-thought-out PHP functions for case-fixing names, that take into consideration the various exceptions that <code>ucwords()</code> would totally butcher, such as:</p>

<ul>
<li>Sven-Alex Crumpet</li>
<li>Ronaldo McDonaldo</li>
<li>Boopsie O'Brien</li>
<li>J.R. Bob Dobbs</li>
<li>Francesca de los Gatos</li>
<li>YungCheng Li</li>
</ul>

<p>Any functions out there that attempt to accommodate these alphabet rebels?</p>

<p><b>UPDATE</b><br>
From Robin v. G.'s point of van-tage, there can be no script to rule them all. But I've decided that names entered entirely in lower or uppercase are likely candidates for a good scrubbing. So for these, I will do ...</p>

<pre><code>    if ($name == strtoupper($name) || $name == strtolower($name)) {
        $name = ucwords(strtolower($name));
    }
</code></pre>

<p>It would be easy enough to modify this to fix a few likely exceptions: dashes, apostrophes, 'McD', etc. Mistakes will be made, but who will complain? Not the meek bastard who entered their name in lowercase.</p>

<p>Oh wait, my name is in lowercase...</p>
