• support@answerspoint.com

How to make the number pyramid pattern in PHP

2682

How to make the number pyramid pattern in PHP

  • PHP

  • asked 6 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 6 years ago
  • Community  wiki

Your Answer

    Facebook Share        
       
  • asked 6 years ago
  • viewed 2682 times
  • active 6 years ago

Best Rated Questions