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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.