RE: [PHP] stepping through alphabet
| From: | Jay Blanchard | Date: | Wed, 19 Nov 2003 14:09:54 +0000 |
| Subject: | RE: [PHP] stepping through alphabet | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170279@lists.php.net to get a copy of this message | ||
[snip]
I am using PHP 4.3.4 and am trying to come up with a function that will
step through the alphabet so that I get a menu/links that can be clicked
on
like below:
<a href="?action=alphabet&letter=A">A</a>
<a href="?action=alphabet&letter=B">B</a>
<a href="?action=alphabet&letter=C">C</a>
etc...........
[/snip]
Create an alphabet array and loop through it ...
$arrayAlphabet = ('A', 'B', 'C', ...., 'Z');
for($i = 0; $i < 25; $i++){
echo "<a
href=\"?action=$arrayAlphabet[$i]\">$arrayAlphabet[$i]</a>\n";
}
Or something like that. The HTML is probably a little of in my example,
but you should be able to work with this.