Well, you could consider something like:
$alf = "abcdefghijklmnopqrstuvw";
$num = "123456789a";
$key = $alf[$i].$alf[$j].$alf[$k].$num[l]$num[n]$num[n]
And use a loop which will make sure i, j, k never reach 23, but instead reset themselve to 1 and set the next in line to the next number, and for l, m, n you make sure they never reach more then 9.
J.