I want to generate a list of all possible two character strings containing alphanumerics only i.e. 36^2 combinations. I want to print this out with a linebreak between each possibility.
I hope someone could help me out with this.
I want to generate a list of all possible two character strings containing alphanumerics only i.e. 36^2 combinations. I want to print this out with a linebreak between each possibility.
I hope someone could help me out with this.
Just modify the $characters
array to include all the characters you want.
<?php
$characters = array('a', 'b', 'c', 'd');
foreach($characters as $first){
foreach($characters as $second){
echo $first.$second.'<br/>';
}
}
?>
Output:
aa
ab
ac
ad
ba
bb
bc
bd
ca
cb
cc
cd
da
db
dc
dd