Re: Regular Expression Help: genreate alphanumeric, 8 chars
| From: | David T-G | Date: | Thu, 27 Nov 2003 12:51:41 +0000 |
| Subject: | Re: Regular Expression Help: genreate alphanumeric, 8 chars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171198@lists.php.net to get a copy of this message | ||
Shaun --
[No need to post twice...]
..and then Shaun said...
%
% Hi,
Hi!
%
% I need to generate a lowercase alphanumeric passwrord thats 8 characters
% long, has anyone got a function that can do this?
This isn't really a regular expression question, since you'd use an
expression to check if a string matched your requirements but not to
generate such a string.
A function should be easy: just loop 8 times over spitting out a random
char between a and z or 0 and 9 (use rand() to generate a number between
0 and 35 and then map that to the char).
%
% Thanks for your help
Enjoy :-)
HTH & HAND
:-D
--
David T-G * There is too much animal courage in
(play) davidtg@justpickone.org * society and not sufficient moral courage.
(work) davidtgwork@justpickone.org -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur
Pbzzhavpngvbaf Qrprapl Npg!