Chris wrote:
> You could create a string, loop through it's length, then access the $i
> character in the string.
>
> $sAlpha = 'ABCDEF...XYZ';
> for($i=0;$i<26;++$i)
> {
>$sLetter = $sAlpha{$i};
>// code
> }
range() is a powerful function for creating such strings. You don't
need to loo
hi Miguel
> I wanna a do a for loop with letters, Is this possible?
>
> for ($i = 'A'; $i <= 'Z'; $i++){
> // code
> }
you can, but it doesn't do what you think it should do. Apparently it
gets to Z, restarts with AA, AB, AC etc and continues like that until it
hits YZ. feck knows why :-/
hth
MIGUEL ANTONIO GUIRAO AGUILAR wrote:
Hi!!
I wanna a do a for loop with letters, Is this possible?
for ($i = 'A'; $i <= 'Z'; $i++){
// code
}
--
MIGUEL GUIRAO AGUILERA
Logistica R8 - Telcel
Tel: (999) 960.7994
Cel: 9931-6
No, but there are multiple ways this ca
mportantly) as expected:
";
}
?>
By the way, this code froze my browser:
";
}
?>
Jos
-Original Message-
From: MIGUEL ANTONIO GUIRAO AGUILAR
[mailto:[EMAIL PROTECTED]
Sent: 26 May 2005 05:38
To: php-db@lists.php.net
Subject: [PHP-DB] Letters loop
Hi!!
I wanna a do a
eceive an integer as a parameter and it
> returns it's corresponding character.
> But it will work!!!
>
> -Original Message-
> From: Bastien Koert [mailto:[EMAIL PROTECTED]
> Sent: Jueves, 26 de Mayo de 2005 08:28 a.m.
> To: [EMAIL PROTECTED]; php-db@lists.php.
nope
chr ( int ascii ) takes the integer
ord ( string string ) takes the string
bastien
From: Miguel Guirao <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: RE: [PHP-DB] Letters loop
Date: Thu, 26 May 2005 09:22:56 -0500
Thanks!!
I think the ord() function should receive an i
hp-db@lists.php.net
Subject: RE: [PHP-DB] Letters loop
try
for ($i =ord( 'A'); $i <= ord('Z'); $i++){
// code
}
bastien
>From: MIGUEL ANTONIO GUIRAO AGUILAR <[EMAIL PROTECTED]>
>To: php-db@lists.php.net
>Subject: [PHP-DB] Letters loop
>Date: Wed, 25 May 200
try
for ($i =ord( 'A'); $i <= ord('Z'); $i++){
// code
}
bastien
From: MIGUEL ANTONIO GUIRAO AGUILAR <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] Letters loop
Date: Wed, 25 May 2005 20:37:47 -0700
Hi!!
I wanna a do a for loop with letters, Is
MIGUEL ANTONIO GUIRAO AGUILAR wrote:
Hi!!
I wanna a do a for loop with letters, Is this possible?
for ($i = 'A'; $i <= 'Z'; $i++){
// code
}
try it.
php -r '
for ($i = "a"; $i < "z"; $i++){ echo $i,"."; } echo "z";'
--
MIGUEL GUIRAO AGUILERA
Logistica R8 - Telcel
Hi!!
I wanna a do a for loop with letters, Is this possible?
for ($i = 'A'; $i <= 'Z'; $i++){
// code
}
--
MIGUEL GUIRAO AGUILERA
Logistica R8 - Telcel
Tel: (999) 960.7994
Cel: 9931-6
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://w
10 matches
Mail list logo