HOW TO MAKE THE STAR TRIANGLE IN PHP – onlinecode

HOW TO MAKE THE STAR TRIANGLE IN PHP – onlinecode

In this post, we will give you information about HOW TO MAKE THE STAR TRIANGLE IN PHP – onlinecode. Here we will give you detail about HOW TO MAKE THE STAR TRIANGLE IN PHP – onlinecode And how to use it also give you a demo for it if it is necessary.

how to make the star triangle in PHP?

Below, you will find a very easy way to draw STAR Triangle in PHP.

You can draw a triangle by using for or foreach loop.

This will improve the logic of fresher.


$m=1;
for($i=1; $i<=5; $i++) { // iterates over number of rows
    for($j=$i; $j<=4; $j++) {
        echo "&nbsp;&nbsp;";
    }
    for($k=1; $k<=$m; $k++)  {
        echo "*";
    }
    for($c=$m; $c>1; $c--) {
        echo "*";
    }
    echo "<br>";
    $m++;
}

 

Label :

 

PHP

How to draw shapes in PHP

How to draw a triangle in PHP

Program

Web Development

Hope this code and post will helped you for implement HOW TO MAKE THE STAR TRIANGLE IN PHP – onlinecode. 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

For More Info See :: laravel And github