I have a code snippet that generates a random code 10 character.
function generator($lenght=10)
{
for($i = 0; $i <= $lenght; $i++)
{
$uniqKey .= chr(rand(97,122));
}
return $uniqKey;
}
$randomN = generator();
When echoed $randomN == ymtkasvaae
But when I change the code to a upper case it adds a character.
$code = strtoupper($randomN);
When output the $code == YMTKASVAAEI
I am confused by such an odd outcome...