Proper surname capitalization in PHP

Possible duplicate:
Name caps in programming

I noticed that people who register on my site are extremely lazy in that they don’t even document their own names.

My site is business-oriented, so there is no “freedom of expression” argument here.

Capitalization of the name is quite simple, since I can not imagine a single instance where the western name would not start with a capital letter. I could be wrong.

But the capital last name becomes more complex, with names like

O'Brien
O´Flaherty
de Wit
McKenzie
Auditore da Firenze
de los Remedios de Escalada
Virta-Jokela

What would be a good solution for the correct automatic capitalization of last names in PHP, which would get the right solution in 95% of cases? I know that .

+3
3

:

  • ,
  • :
    • - ( "de", "los" ..), .
    • , , ( , "O", "Mc" ..). , (, O" O') , .
    • .
+4

: , . , foo bar foo bar.

, , :

  • de Wit
  • de los Remedios

, ('de', 'da', 'de los', ). , "De", "Da" "De Los" () , .

: , , .

+1

$name = ucwords(strtolower($name));

95% .

, de los Remedios de Escalada ? de los Remedios de Escalada. , .

- "" Last word ucword()

-1

All Articles