• support@answerspoint.com

How to make the number pyramid pattern in PHP

2796

How to make the number pyramid pattern in PHP

  • PHP

  • asked 7 years ago
  • Priyanka Roy

1Answer


0

Use this code for make the number pyramid in PHP 

<html>
    <head>
    <title>make the number pyramid in PHP</title>
    </head>
<body>
	<?php
		for($i=0;$i<=9;$i++)
		{
			for ($d=10-$i; $d > 0; $d--)  
			{
				echo "&nbsp;&nbsp;";
			}
			for($j=1;$j<=$i;$j++)
			{
				echo "&nbsp;".$i."&nbsp;";
			}
			echo "<br>";
		}
    ?>
</body>
</html>

 

  • answered 7 years ago
  • Community  wiki

Your Answer

    Facebook Share        
       
  • asked 7 years ago
  • viewed 2796 times
  • active 7 years ago

Best Rated Questions