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? 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 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 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
Archived
This topic is now archived and is closed to further replies.