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 arra
:[EMAIL PROTECTED]]
> Sent: Friday, January 25, 2002 8:57 AM
> To: PHP List
> Subject: [PHP] Arrays as pointers?
>
>
> A friend of mine showed me this code recently.
>
> function firstLogin_string() {
> mt_srand(make_seed());
> $pool = "AaBbCcDdEeFfGgHhIiJjK
v0idnull,
[surely you don't think of yourself as a nonentity twice over?]
> 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_ran
ssage-
From: v0idnull [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 25, 2002 8:57 AM
To: 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&qu
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)];
}
retu
5 matches
Mail list logo