09-23-2010, 08:30 PM
|
#3 (permalink)
|
|
The Contributor
Join Date: Nov 2007
Posts: 41
Thanks: 24
|
OK... I did take out a function I wrote which counted results per number... Inside the each loop.. there is a count function that would count the amount of values and if it exceeded 200, it would go two letters deep and if needed then three letters deep. Maybe I'm overthinking this... but i been trying to figure this out for a couple hours now. I was able to do it manually like in the code sample above. But I was thinking how it could be possible to make it automatically detect any character result count and automatically go an extra level deep if needed. is this possible to do this automatically?
PHP Code:
<?php
header("Content-type: text/plain");
$arr = 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");
for ($t=0; $t<26; $t++){
$oneLetter = countData($blah);
if($oneLetter >= 200){ //if the results for oneLetter is 200 or more then go one extra letter
for ($t1=0; $t1<26; $t1++){
$twoLetter = countData($blah);
if($twoLetter >= 200){ //if the results for twoLetter is 200 or more then go one extra letter
for ($t2=0; $t2<26; $t2++){
echo $arr[$t].$arr[$t1].$arr[$t2]. "\n";
}
}else{
echo $arr[$t].$arr[$t1]. "\n";
}
}
}
__________________
"Things you can get access to, you should never memorize." -Albert Einstein
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
|
|
|
|