PHP Alphabet Loop

A simple way to output all the letters of the alphabet in a loop. You can use this code for making quicklinks for filtering, etc.

PHP:
  1. <?php for ($i=65; $i<=90; $i++) echo chr($i); ?>

Another cool way to do it would be to use the PHP range funtion which can take the letters of the alphabet as parameters in a loop like this:

PHP:
  1. <?php foreach(range('A','Z') as $i) echo $i; ?>

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • Reddit
  • Furl
  • NewsVine
  • Simpy
  • Slashdot
  • Spurl
  • StumbleUpon
  • YahooMyWeb
  • TailRank
  • Technorati

Home | PHP | PHP Alphabet Loop