I need to create a link from a to z. I come up with a simple way to do it.
/* a-z */
$str = '';
for($i = 65; $i < 91; ++$i)
echo ''.chr($i).'';
another way
$a = range('a', 'z');
foreach($a as $chr) echo $chr;
I need to create a link from a to z. I come up with a simple way to do it.
/* a-z */
$str = '';
for($i = 65; $i < 91; ++$i)
echo ''.chr($i).'';
another way
$a = range('a', 'z');
foreach($a as $chr) echo $chr;
January 5, 2009 at 9:05 pm |
Just wanted to add, that it’s possible to do it like this:
for($i=A;$i<Z;++$i) echo ‘‘.$i.’‘;
January 6, 2009 at 7:52 am |
thanks willcodeforfun! awesome
for($i='A';$i<'Z';++$i) echo $i;