Pyramid in PHP Part I

PHP Pyramid Part I
PHP Pyramid Part I

<?php
 $limit = 5;
 for($i=0;$i<=$limit;$i++) 
 { 
   for($k=$i;$k>0;$k--)
   {
     echo $k;
   }
   echo "<br/>";
 }
?>
Output:
1
21
321
4321
54321

 

You may also like...