• support@answerspoint.com

How to make the number pyramid pattern in PHP

419

How to make the number pyramid pattern in PHP

  • PHP

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

Your Answer

    Facebook Share