Easy, assign a number to each character, then for next loop across all the possibilities.
$chars = array("a","d","i","k","z");
for ($i=0;$i<5;$i++){
for ($j=0;$j<5;$j++){
for ($k=0;$k<5;$k++){
for ($l=0;$l<5;$l++){
for ($m=0;$m<5;$m++){
$list[] =$chars[$i].$chars[$j].$chars[$k].$chars[$l].$chars[$m];
}
}
}
}
}
Note that by using a depth variable you could do this with a recursive array for unknown numbers of characters.
If you'd like them random, then shuffle() the array when done, although for large arrays this can be very slow.
If you want ONE at random, initialize the random seed, then do:
print $list[rand(0,count($list)-1)];