No, that won't work
Either use != 'AA'
or
for( $i = ord('A'); $i <= ord('Z'); $i++)
{
echo chr( $i ) . ' ';
}
Jason skrev:
Because you need $i<= 'Z' to get Z included as well.
J
At 08:49 09/07/2007, Xell Zhang wrote:
Hello all,
I met a very strange problem today. Take a look at the codes below:
for ($i = 'A'; $i < 'Z'; $i++) {
echo $i . ' ';
}
If you think the output is A-Z, please run it on your server and try.
Who can tell me why the result is not A-Z?
--
Zhang Xiao
Junior engineer, Web development
Ethos Tech.
http://www.ethos.com.cn
--
/Thunis
"Why do you need to think? Can't we just sit and go budumbudumbudum with
our lips for a bit?"
--The Hitchikers Guide to the Galaxy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php