Re: Letters in Loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php
    for( $ii = ord( 'A' ); ii <= ord( 'Z' ); $ii++ ) {
        echo chr( $ii );
        }
?>


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", without
moving on to "AA" and continuing?

--
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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux