print a-z

By paragasu

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;

2 Responses to “print a-z”

  1. willcodeforfun Says:

    Just wanted to add, that it’s possible to do it like this:

    for($i=A;$i<Z;++$i) echo ‘‘.$i.’‘;

    :)

  2. paragasu Says:

    thanks willcodeforfun! awesome ;)


    for($i='A';$i<'Z';++$i) echo $i;

Leave a Reply