Welcome Guest, Not a member yet? Register   Sign In
Three letter complete list
#2

[eluser]mddd[/eluser]
You could make it even nicer by doing a recursive function to allow any length you want.
But I think this will work. 1 to 3 letters in length.
Code:
$results = array();

for($c1=1;$c1<27;$c1++) { // count c1 from 1 (=a) to 26 (=z)
for($c2=0;$c2<27;$c2++) { // count c2 from 0 (=nothing) to 26 (=z)
for($c3=0;$c3<27;$c3++) { // count c3 from 0 =nothing) to 26 (=z)

  $word = chr($c1+96);
  if ($c2) $word .= chr($c2+96);
  if ($c3) $word .= chr($c2+96);
  $results[] = $word;

}
}
}
// after this, $results will contain all the variations.


Messages In This Thread
Three letter complete list - by El Forum - 05-06-2010, 05:23 AM
Three letter complete list - by El Forum - 05-06-2010, 05:38 AM
Three letter complete list - by El Forum - 05-06-2010, 05:46 AM
Three letter complete list - by El Forum - 05-06-2010, 05:50 AM
Three letter complete list - by El Forum - 05-06-2010, 05:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB