Forum Moderators: coopster
I need to know how to generate all possible string combinations like....
aa
ab
ac
bb
...
aaa
bbb
ccc
aba
aca
aab
aac
...
The number of characters will be dynamic. the above one is for 3 chars.
plsssssssssss tell me how can i generate this?
I will use that list as input to the whois Server. From the result given I can split them up into different categories, I think so, but I dont know whether will that do or not.
I need more help about this. Can u gimme plz.
currently Im checking this...
$ar1=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9');
for($i=1; $i<=1; $i++)
{
for($j=$i;$j<count($ar1);$j++)
{
for($k=$j;$k<count($ar1);$k++)
{
print "<br>".$ar1[$i].$ar1[$j].$ar1[$k];
}
}
}
but this will generate strings of only 3 chars.
I also tried the following code
$j=0;
for($i='a'; $i<='zzz'; $i++)
{
print "$i<br>";
$j++;
if($i=="zzz")
{
exit;
}
}
But I think i have to do it with some recursive function.
Thanks in advance
senkum