Re: print a to z

From: Date: Fri, 16 Jan 2009 08:51:48 +0000
Subject: Re: print a to z
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-286490@lists.php.net to get a copy of this message
paragasu schreef: > i have this cute little problem. sounds more like a homework assignment. by now you know range(), by all means have array_map() too: array_map("print_r", range("a","z")); > i want to print a to z for site navigation > my first attempt work fine > > for($i = '65'; $i < '91'; ++$i) > echo chr($i); > > but someone point me a more interesting solutions > > for($i = 'a'; $i < 'z'; ++$i) > echo $i > > the only problem with the 2nd solutions is it only print up to Y without z. > so how to print up to z with the 2nd solutions? because it turn out > that you cant to something > like for($i = 'a'; $i <= 'z'; ++$i).. STFA - Rasmus Lerdorf has explained exactly why this works the way it does more than once IIRC. > thanks >

« previous php.general (#286490) next »