I use PHP to insert form entries into a MySQL database. Sometimes users enter text in all caps. Is there any way to change it so that only the first letters are capitalized? ucwords(strtolower($word))
won't work for me because I do not want to capitolize the first letter if it was not already capitalized.
My main concern is when people submit their last names. Most people submit it correctly, but some submit it as all caps. If it is all caps, it should work the same as ucwords(strtolower($word))
, but if someone submits their name as De la Rosa
, I wouldn't want it to change to De La Rosa
.