Jump to content

letter counter


dingus

Recommended Posts

ok im stuck and its hard to describe the issue because if i could i would Google for it

 

but here it is

 

i basically need a simple peace of code to incroment by letters

 

a

b

c

d

...

aa

ab

ac

ad

....

ba

bb

bc

bd

..

..

..

..

aaa

aab

..

aba

abb

 

 

basically i want it to generate a list like that (and i know it will end up as a big ass list and probably have memory issues at some point) but can some one please point me in the right direction?

Link to comment
https://forums.phpfreaks.com/topic/87196-letter-counter/
Share on other sites

You could make some code similar to this

 

<?php
//one letter
$letter=0;
while($letter<26){
echo $letters[$letter]."\n";
$letter++;
}
//two letters
$letter=0;
while($letter<26){
$letter_b=0;
while($letter_b<26){
	echo $letters[$letter].$letters[$letter_b]."\n";
	$letter_b++;
}
$letter++;

}
?>

 

Scott

Link to comment
https://forums.phpfreaks.com/topic/87196-letter-counter/#findComment-445970
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.