alphabets generation
Moderator: General Moderators
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
alphabets generation
I want to generate alphabets form a-z, Is there any php function for this.
how about for() loop ? Especially
Code: Select all
for($i='a';$i<='z';$i++) echo $i."<br>";- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Does that work?miro_igov wrote:how about for() loop ? EspeciallyCode: Select all
for($i='a';$i<='z';$i++) echo $i."<br>";
Code: Select all
<?php
for ($i = ord("a"); $i <= ord("z"); $i++) {
echo chr($i);
}Code: Select all
range('a', 'z');- WaldoMonster
- Forum Contributor
- Posts: 225
- Joined: Mon Apr 19, 2004 6:19 pm
- Contact:
On my system it doesn't work (php 4).Weirdan wrote:It does.d11wtq wrote: Does that work?
The list goes from a - yz
I use it this way:
Code: Select all
<?php
for($i = 'a'; $i != 'aa'; $i++)
echo $i . '<br>';
?>Does that work?
I'd have done this:
[/quote]
d11wtq, the low number of posts in this forum does not mean a newbie
Code: Select all
<?php
for ($i = ord("a"); $i <= ord("z"); $i++) {
echo chr($i);
}d11wtq, the low number of posts in this forum does not mean a newbie