beansandsausages Posted January 16, 2008 Share Posted January 16, 2008 Hello all, i am just starting to use loops and was woundering is it possable to loop all the letters of the alpabet in a link for example : ATM i have 26 links : <a href=?action=a>A</a> <a href=?action=b>B</a> <a href=?action=ac>C</a> etc .... is itpossable to do it in a loop? Quote Link to comment https://forums.phpfreaks.com/topic/86287-solved-loop/ Share on other sites More sharing options...
trq Posted January 16, 2008 Share Posted January 16, 2008 <?php foreach (range('a','z') as $letter) { echo "<a href='?action=$letter'>" . strtoupper($letter) . "</a>"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/86287-solved-loop/#findComment-440799 Share on other sites More sharing options...
beansandsausages Posted January 16, 2008 Author Share Posted January 16, 2008 Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/86287-solved-loop/#findComment-440800 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.