hi there,
I want to generate 6 character membership number, i can't figure it out how to do it.
i found this code from php.net, but not sure how to use?😟
can someone please help.
I want to generate 6 character membership number, i can't figure it out how to do it.
i found this code from php.net, but not sure how to use?😟
<?php
function randomAlphaNum($length){
$rangeMin = pow(36, $length-1); //smallest number to give length digits in base 36
$rangeMax = pow(36, $length)-1; //largest number to give length digits in base 36
$base10Rand = mt_rand($rangeMin, $rangeMax); //get the random number
$newRand = base_convert($base10Rand, 10, 36); //convert it
return $newRand; //spit it out
}
?>
can someone please help.
This topic is locked and no more replies can be posted.