Understanding php's logic

Ashley Oviatt ashovi at qwest.net
Tue Apr 6 13:44:02 MDT 2004


 From the php.net site: 
(http://us3.php.net/manual/en/control-structures.for.php)
----------------------------------------------------------

for ($i="A"; $i <= "Z"; $i++) echo "$i<br>";

will actually output A-Z, then begin again with AA, AB, etc. until it 
finishes with YZ.

----------------------------------------------------------

Ok, this seems weird to me for some reason. Why doesn't the loop stop 
when it reaches the character Z? If you put in a Y in place of the Z, it 
stops at Y.

Why does it do this?

Ash




More information about the UPHPU mailing list