HormonX
10-28-2002, 08:37 PM
Hello,
can someone sugest me a way to create a random sequence of letters and numbers ? I have a script that does that .. but it's very incosistent. What's happening is ... one time it will create a 20 caracter string, but next time it will only create a 5 caracter string. here it is below.
$length = 20;// set this to legth of the random word/number
$p = "0wxVWvKH678FSbkUXIJ".
"aefglm9ijD5yGupqrs".
"AE3cdLMNOPhtz124BYCZQRnoT";
$r1 = substr($p, (rand() % strlen($p)), $length);
$string = $r1;
any sugestions ?
HormonX
can someone sugest me a way to create a random sequence of letters and numbers ? I have a script that does that .. but it's very incosistent. What's happening is ... one time it will create a 20 caracter string, but next time it will only create a 5 caracter string. here it is below.
$length = 20;// set this to legth of the random word/number
$p = "0wxVWvKH678FSbkUXIJ".
"aefglm9ijD5yGupqrs".
"AE3cdLMNOPhtz124BYCZQRnoT";
$r1 = substr($p, (rand() % strlen($p)), $length);
$string = $r1;
any sugestions ?
HormonX