How to Print Triangle of Stars in PHP

Prem Tiwari - - PHP Tutorials


Hi friend, hope you are doing good. In this tutorial, we will let you know how to print triangle of stars in PHP programming language.

Copy the below code and create a new PHP file and paste, after that execute that file with the help of PHP compiler to see the output.

*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *

Reverse order print star pattern

Below PHP program will print the star pattern in reverse order.

* * * * * * *
* * * * * *
* * * * *
* * * *
* * *
* *
*