No, no bug.  I believe you would end up with something like that if the for
loop is evaluating the letters numerically (either as ASCII values or some
other value).  The examples below would be the proper way of printing a
range of letters...

$letters = range('a', 'z');
for ($i=0; $i<count($letters); $i++)
{
   echo $letters[$i];
}

.. or..

foreach(range('a', 'z') as $letter)
{
   echo $letter;
}

Hope this helps.
-Kevin

----- Original Message -----
From: "Erich Reimberg N" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 16, 2002 11:27 AM
Subject: [PHP] BUG?: for loop using chars


> Hello,
>
> I'm trying to generate this list of letters A..Z, using this
>
>    for ($l='A'; $l<='Z'; $l++)
>       echo $l."-";
>
> And it doesn't work. It generates the output included at the end of
> this message (I used .... to be shorter)
>
> But this works
>    for ($l='A'; $l<='Y'; $l++)
>       echo $l."-";
> generating the expected output.
>
> IS this a bug in PHP?
>
> Any help? Please, if you can, Cc to my email: [EMAIL PROTECTED]
>
> TIA,
> Erich
>
> ---
> Wrong output:
> 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-AD-AE-AF-
> AG-AH-AI........-YV-YW-YX-YY-YZ-
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to