Re: Re: Generate Alphabet
| From: | Bogdan Stancescu | Date: | Thu, 27 Dec 2001 12:28:00 +0000 |
| Subject: | Re: Re: Generate Alphabet | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78833@lists.php.net to get a copy of this message | ||
I seriously doubt your code works -- have you tested it? I think the code
you submitted will most probably output "1 2 3 4...24 25 26" (spaces are
actually \n's). I never tested it though, so I may be mistaken.
However, with just a few changes we get
$letter='a';
$i=0;
while ($letter<'z') {
$letter=Chr(ord($letter)+$i);
$i++;
print("$letter<br>\n");
}
which should work.
Bogdan
Philip Olson wrote:
> Consider this example:
>
> $letter = 'a';
> $i = 0;
> while ($i++ < 26) {
> print "Letter: ". $letter++ ."\n";
> }