print alphabetical letters in PHP (5 lines only)

print alphabetical letters by PHP (5 lines only)

simple php script that print alphabetical letters .


Hey All , :D 

In this topic i will print English alphabetical letters 
Here is My code : 
CODE: SELECT ALL

<?php
$letter 
'A' ;
    for(
$i=0;$i<26;$i++){
        echo 
$letter++ ;
        echo 
"<br />\n" ;
    }
?>

Thanks in Advance !

Comments

Or even better

Or even better, in one line
array_walk( range( 65, 90 ), create_function( '$a', 'echo chr( $a );' ) );

// I can't use array_walk( range( 65, 90 ), 'chr' ) because array_walk gives value and index, and chr is only expecting one argument ...

Last edited Jan 18, 2009 11:50 AM
Report abusive comment
Article rating:
Your rating:

Reviews

    Knol translations

    Categories

    Based on community consensus.

    Activity for this knol

    This week:

    5pageviews

    Totals:

    144pageviews
    1comments