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? 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>"; } ?> 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. Link to comment https://forums.phpfreaks.com/topic/86287-solved-loop/#findComment-440800 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.