RE: [PHP] A to Z incremental

From: Date: Thu, 22 Apr 2004 15:05:23 +0000
Subject: RE: [PHP] A to Z incremental
Groups: php.general 
Request: Send a blank email to php-general+get-184248@lists.php.net to get a copy of this message
<snip> > Hi! > Got this script: > > <?php > for($i='A';$i<='Z';$i++){ echo $i.' | '; } >> > > The output is: > A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R > | S | T | U | V | W | X | Y | Z | AA | AB | AC | ... YX | YY | YZ > | > > where is should display only letters from A to Z. > Why is that? > </snip> Hi, Paul. Try this instead. $x = 65; for ($i=0; $i<26; $i++) { echo chr($x); $x++; } Set $x to 97 to get lowercase letters. HTH. Pablo.

« previous php.general (#184248) next »