Generating Logins
| From: | Rohan Amin | Date: | Thu, 03 Aug 2000 19:22:54 +0000 |
| Subject: | Generating Logins | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-10014@lists.php.net to get a copy of this message | ||
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 :-)