Random alphanumeric pin?
<p>I'm working on creating a random 5 character pin for a script. I was wondering if anyone else had a better one?</p>

<pre><code>$pin = '';
while($i != 5){
    $string = '23456789abcdefghjkmnprstvwxyzABCDEFGHJKLMNPRSTVWXYZ'; 
    $pos = rand(0,(strlen($string)-1));
    $pin = $pin . $string[$pos];
    $i++;
}

echo $pin;
</code></pre>
