joecooper Posted June 15, 2008 Share Posted June 15, 2008 how can i have some code that will output somthing like this: 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 aa ab ac ad ae af ag ah ai ... and so on till 3 characters? Quote Link to comment https://forums.phpfreaks.com/topic/110325-help-with-loops-and-letters/ Share on other sites More sharing options...
joecooper Posted June 15, 2008 Author Share Posted June 15, 2008 bump Quote Link to comment https://forums.phpfreaks.com/topic/110325-help-with-loops-and-letters/#findComment-566060 Share on other sites More sharing options...
wildteen88 Posted June 15, 2008 Share Posted June 15, 2008 PHP can increment characters, just like it can with numbers. Example <?php $char = 'a'; for($i = 0; $i < (26*26*26+702); $i++) { echo ($char++) . "<br />\n"; } ?> Prints letters a through to zzz Quote Link to comment https://forums.phpfreaks.com/topic/110325-help-with-loops-and-letters/#findComment-566086 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.