RE: [PHP] Generating Logins

From: Date: Thu, 03 Aug 2000 19:25:21 +0000
Subject: RE: [PHP] Generating Logins
Groups: php.general 
Request: Send a blank email to php-general+get-10017@lists.php.net to get a copy of this message
Do this: $FIRST_NAME = eregi_replace("[^a-z]","",$FIRST_NAME); $LAST_NAME = eregi_replace("[^a-z]","",$LAST_NAME); That strips out all characters that aren't a through z. --Bruce Bruce Christensen Intel Corporation brucex.r.christensen@intel.com -----Original Message----- From: Rohan Amin [mailto:ramin@givingcapital.com] Sent: Thursday, August 03, 2000 12:23 PM To: php-general@lists.php.net Subject: [PHP] Generating Logins Hello, I want to be able to generate a User Name given the First Name and Last Name. I want the User Name to be the first initial of the first name and the first 7 characters of the last name for a total of 8 characters. Right now I have the following: $USER_NAME = substr($FIRST_NAME, 0, 1); $USER_NAME .= substr($LAST_NAME, 0, 7); In most cases, that works fine. However, if someone has a last name such as "O'Donnell", then the generated $USER_NAME will equal ko'donne when I would rather have it be kodonnel. How do I get it to ignore the ' character in the last name when generating a user name? Thanks, Rohan :-) -- 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 (#10017) next »