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
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
> -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++) {
> echo "$i";
> }
>
> Produces:
>
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
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
Subject: [PHP] Letters in Loops
In try
5 matches
Mail list logo