Why does it work this way?

From: Date: Mon, 02 Apr 2001 13:27:36 +0000
Subject: Why does it work this way?
Groups: php.general 
Request: Send a blank email to php-general+get-46611@lists.php.net to get a copy of this message
for( $i = "a"; $i <= "z"; $i++ ) { } Not entirely too sure why, but the above works. And it's really cool that it does. :) However, it doesn't work as one would expect (aside from the fact that it works at all :p). Just looking at it, I would think that it would iterate from "a" to "z" and stop. But in fact, what it's doing is going from "a" to "yz", having iterated all of the alphabet using double letters ( "aa", "az", "bb", "bz" ... "yy", "yz"). Why is that? Just trying to understand. :) Thanks for any help/insight you can provide! Chris

« previous php.general (#46611) next »