A friend of mine showed me this code recently.
function firstLogin_string() {
mt_srand(make_seed());
$pool = AaBbCcDdEeFfGgHhIiJjKkLlM;
$length = 26;
for($i=0; $i $length; $i++) {
$key .= $pool[mt_rand(0,strlen($pool)-1)];
}
return
PHP List
Subject: [PHP] Arrays as pointers?
A friend of mine showed me this code recently.
function firstLogin_string() {
mt_srand(make_seed());
$pool = AaBbCcDdEeFfGgHhIiJjKkLlM;
$length = 26;
for($i=0; $i $length; $i++) {
$key .= $pool[mt_rand(0,strlen($pool)-1)];
}
return $key;
I could be wrong about this, but here goes:
Strings are in fact arrays. An array of characters. The code your
friend gave you manipulates this array in the same way that it would any
normal array. The only problem (not really a problem even) is that
when dealing with character-based
3 matches
Mail list logo