Random key generator

Generates a random key, a-Z 0-9 with no max length

Usage

Use as demonstrated in the comment. This can be good to append to a url and store in a database, and check for in a site registration during email validation (i.e. http://site.com/register.php?connfirmationcode=2QwYbI0mf4exPi

Comments

Posted on 28.03.2011 12:23 by guest

What about uniqueness?

Posted on 19.10.2010 20:28 by guest

fuck

Posted on 09.08.2010 12:57 by guest

nice, i use something similar
<?php
function generatekey($length)
{
$options = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$code = "";
for($i = 0; $i < $length; $i++)
{
$key = rand(0, strlen($options) - 1);
$code .= $options[$key];
}

return $code;
}
// echo generatekey(10); // Ko9B69utve, returned result is random. not only is this good for ac validatin but has several other applicvations, eg captch ect its uses are limitless.
?>