<?
function getToken($length=16)
{
mt_srand(100000000 * (double)microtime());
$pool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
$pool .= "abcdefghijklmnopqrstuvwxyz";
$pool .= "1234567890";
$lastchar = strlen($pool) - 1;
for($i=0; $i<$length; $i++)
{
$token .= $pool[mt_rand(0, $lastchar)];
}
return($token);
}
?>
Jason