How to make the number pyramid pattern in PHP
How to make the number pyramid pattern in PHP
PHP
- asked 7 years ago
- Priyanka Roy
1Answer
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 " ";
}
for($j=1;$j<=$i;$j++)
{
echo " ".$i." ";
}
echo "<br>";
}
?>
</body>
</html>
- answered 7 years ago
- Community wiki
Your Answer