Adam --
...and then Adam i Agnieszka Gasiorowski FNORD said...
%
...
% How about,
%
% $password = strtolower(substr(md5(uniqid(time())), 0, 7));
Hey, that's pretty slick. Good one! Gonna have to remember that; it's
an excellent trick.
Thanks HAND
:-D
--
David T-G
Hi,
I need to generate a lowercase alphanumeric passwrord thats 8 characters
long, has anyone got a function that can do this?
Thanks for your help
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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
...as in...
?
// Could've been done with ASCII sets, but this way
// you can easily tweak the eligible characters.
$eligible='abcdefghijklmnopqrstuvwxyz0123456789';
$pwdLen=8;
$password='';
for($i=0;$i$pwdLen;$i++) {
$password.=$eligible[rand(0,strlen($eligible))];
}
echo(Your
Bogdan --
...and then Bogdan Stancescu said...
%
% ...as in...
%
% ?
% // Could've been done with ASCII sets, but this way
% // you can easily tweak the eligible characters.
% $eligible='abcdefghijklmnopqrstuvwxyz0123456789';
% $pwdLen=8;
% $password='';
% for($i=0;$i$pwdLen;$i++) {
Shaun wrote:
Hi,
I need to generate a lowercase alphanumeric passwrord thats 8 characters
long, has anyone got a function that can do this?
No, but I can write a quick one for you. Can't guarantee the uniqueness
of the password being generated.
function passgen()
{
srand((float) microtime()
David T-G wrote:
Bogdan --
...and then Bogdan Stancescu said...
%
% ...as in...
%
% ?
% // Could've been done with ASCII sets, but this way
% // you can easily tweak the eligible characters.
% $eligible='abcdefghijklmnopqrstuvwxyz0123456789';
% $pwdLen=8;
% $password='';
7 matches
Mail list logo