PHP Alphabet Pattern 17

Last Updated:

PHP Alphabet Pattern 17

Try to print the following alphabet pattern using PHP.

Print This Output
EDCB*
EDC*A
ED*BA
E*CBA
*DCBA

Source Code

PHP Compiler
<?php $alpha = range('A', 'Z'); $k = 0; for($i=0; $i<=4; $i++) { for($j=4; $j>=0; $j--) { if($j == $i) echo "*"; else echo $alpha[$j]; } echo "<br>"; } ?>

Share this Page

Meet the Author