How to make the number pyramid pattern 1 in PHP
In this post we will give you information about How to make the number pyramid pattern 1 in PHP. Hear we will give you detail about How to make the number pyramid pattern 1 in PHPAnd how to use it also give you demo for it if it is necessary.
PHP for loop execute a block of code for specified number of times.
Using for or foreach loop to draw/make number pyramid is much easier.
I am using for loop to draw/make number pyramid because of it is easier to understand that how many rows i have to iterate.
Number Pyramid
for($i=0;$i<=9;$i++){ for ($d=10-$i; $d > 0; $d--) { echo " "; } for($j=1;$j<=$i;$j++){ echo " ".$i." "; } echo "<br>"; }
Label :
PHP
How to draw shapes in PHP
How to draw triangle in PHP
Program
Pyramid
Hope this code and post will helped you for implement How to make the number pyramid pattern 1 in PHP. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs