RE: [PHP] Generating Logins
| From: | Sam Masiello | Date: | Thu, 03 Aug 2000 19:25:11 +0000 |
| Subject: | RE: [PHP] Generating Logins | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10018@lists.php.net to get a copy of this message | ||
You can use an ereg_replace to strip out any characters that you don't want.
http://www.php.net/manual/function.ereg-replace.php
HTH
Sam Masiello
System Analyst
Chek.Com
(716) 853-1362 x289
smasiello@chekinc.com
-----Original Message-----
From: Rohan Amin [mailto:ramin@givingcapital.com]
Sent: Thursday, August 03, 2000 3:25 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Generating Logins
Oh, I am assuming that the first name is Kate...that's where the "k" comes
from.
"Rohan Amin" <ramin@givingcapital.com> wrote in message
news:8mcgqg$lod$1@toye.php.net...
> 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
>
--
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