it should look something like this mKa8dU01.
I found this on another forum, its for a URL shortener.
Code: Select all
for($counter=0; $counter < 10000; $counter+=1) {
$shorturl = "";
$tmp_count = $counter;
for($i=5;$i>=0; $i--) {
$tmp = floor($tmp_count/pow(36,$i));
$tmp_count -= $tmp*pow(36,$i);
if($tmp < 10) {
$shorturl .= chr($tmp + 48);
} else {
$shorturl .= chr($tmp + 87);
}
}
}
Thanks