[PHP] Arrays as pointers?

2002-01-24 Thread v0idnull
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

Re: [PHP] Arrays as pointers?

2002-01-24 Thread Mike Frazer
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;

Re: [PHP] Arrays as pointers?

2002-01-24 Thread Erik Price
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