Re: [PHP] Letters in Loops

2006-03-23 Thread John Nichel
phpninja wrote: Hello, for($i=A;$i<=Z;$i++) { if ($i == "ZZ") { break; } echo "$i"; } regards, phpninja While this may work (I didn't test it), it's a hack and might produce unexpected results (assuming you meant to quote the strings). PHP will, "Translate strings and resources to numbe

Re: [PHP] Letters in Loops

2006-03-23 Thread Jochem Maas
Ben Miller wrote: In trying to make an alpha list, using the following: for($i=A;$i<=Z;$i++) { ^ not a string technically! see what happens when you turn up error reporting to full (E_ALL). echo "$i"; } rather than using a loop to generate (as others have shown

RE: [PHP] Letters in Loops

2006-03-23 Thread Ford, Mike
> -Original Message- > From: Ben Miller [mailto:[EMAIL PROTECTED] > Sent: 23 March 2006 15:08 > To: php-general@lists.php.net > Subject: [PHP] Letters in Loops > > > In trying to make an alpha list, using the following: > > for($i=A;$i<=Z;$i++) { >

Re: [PHP] Letters in Loops

2006-03-23 Thread Evan Priestley
On Mar 23, 2006, at 10:08 AM, Ben Miller wrote: In trying to make an alpha list, using the following: for($i=A;$i<=Z;$i++) { echo "$i"; } Produces: A B C... X Y Z AA AB AC... AX AY AZ... all the way to YZ. What am I doing wrong that it's not stopping at just plain old "Z", witho

RE: [PHP] Letters in Loops

2006-03-23 Thread phpninja
Hello, for($i=A;$i<=Z;$i++) { if ($i == "ZZ") { break; } echo "$i"; } regards, phpninja -Original Message- From: Ben Miller [*mailto:[EMAIL PROTECTED] <[EMAIL PROTECTED]>] Sent: Thursday, March 23, 2006 7:08 AM To: php-general@lists.php.net Subjec

[PHP] Letters in Loops

2006-03-23 Thread Ben Miller
In trying to make an alpha list, using the following: for($i=A;$i<=Z;$i++) { echo "$i"; } Produces: A B C... X Y Z AA AB AC... AX AY AZ... all the way to YZ. What am I doing wrong that it's not stopping at just plain old "Z", without moving on to "AA" and continuing? -- PHP General Ma