PHP Alphabet Loop
Like this blog? Consider exploring one of our sponsored banner ads...
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 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 foreach(range('A','Z') as $i) echo $i; ?>
About this entry
You’re currently reading “PHP Alphabet Loop,” an entry on BRADINO
- Published:
- 3.24.07 / 5pm
- Category:
- PHP
- Tags:
8 Comments
Jump to comment form | comments rss [?]