A friend of mine showed me this code recently.

function firstLogin_string() {
        $pool = "AaBbCcDdEeFfGgHhIiJjKkLlM";
        $length = 26;
        for($i=0; $i < $length; $i++) {
                $key .= $pool[mt_rand(0,strlen($pool)-1)];
        return $key;

look at the for loop. $pool is not an array but is being treated as such and
the key happens to be the position in $pool and it'll take that letter and
save it to $key. I've never seen this done before. What is this method
called and what other neat tricks can you do in respect to this?

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to