Re: A to Z incremental
| From: | John W. Holmes | Date: | Thu, 22 Apr 2004 15:41:02 +0000 |
| Subject: | Re: A to Z incremental | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184256@lists.php.net to get a copy of this message | ||
From: "Paul" <lists@pardel.net>
> <?php
> for($i='A';$i<='Z';$i++){ echo $i.' | '; }
> ?>
>
> The output is:
> A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S
| T | U | V | W | X | Y | Z |
> AA | AB | AC |
> ...
> YX | YY | YZ |
>
> where is should display only letters from A to Z.
> Why is that?
'AAAAA' is less than 'Z' when we're talking about strings. Same as
'1000' is
less than '2' when compared as strings. Doesn't really answer "why", but
that's just how it is. :)
---John Holmes...