RE: [PHP] Capitalize Function ??

From: Date: Tue, 24 Jul 2001 02:15:31 +0000
Subject: RE: [PHP] Capitalize Function ??
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59291@lists.php.net to get a copy of this message
I think ucfirst() only does the first character of the string... ucwords() will do all the parts of the name. The only shortcoming I've found is if people put in a middle initial and add a period to it, or put a nickname in quotes... ucwords() skips those. -----Original Message----- From: Opec Kemp [mailto:mailinglist@quasarz.com] Sent: Monday, July 23, 2001 9:53 PM To: PHP Junkie Cc: PHP List Subject: RE: [PHP] Capitalize Function ?? The function that you want is called: ucfirst() http://www.php.net/manual/en/function.ucfirst.php To make sure that string are consistant you might want to convert all characters in the string to Lower case first then call this function. This will ensure that stuff like "JoHn sMITH" gets converted to "John Smith" consistantly. > -----Original Message----- > From: PHP Junkie [mailto:php091565@netscape.net] > Sent: Tuesday, July 24, 2001 11:39 AM > To: php-general@lists.php.net > Subject: [PHP] Capitalize Function ?? > > > I know this one will be an easy one ... > > I'm taking in first name and last name data into a MySQL db through a > form. Users sometimes don't capitalize their first and last names when > entering the data. Is there a function to clean this up for > consistency? If so, what is the name of the function that performs > this? > > Thanks in advance, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#59291) next »