You could use:
$name = ucwords(strtolower($name));
However, note that "PETER O'TOOLE" would then become "Peter O'toole". and "Pierre duPont" would become "Pierre Dupont". This is probably why you often see mail lists and such simply output names in all caps (e.g. with the strtoupper() function).