Showing posts with label php program to print hellow triangle star pattern. Show all posts
Showing posts with label php program to print hellow triangle star pattern. Show all posts

Friday, May 31, 2024

php program to print hollow triangle star pattern


php program to print hollow triangle star pattern


 php program to print hollow triangle star pattern 

Example :-

<?php
$size =5;
for($i=1;$i<=$size;$i++)
{
    for($j=0;$j<$i;$j++)
    {
        if($i!=$size)
        {
            if($j==0||$j==$i-1)
            {
                echo '*';
            }
            else{
                echo "&nbsp;&nbsp;";
            }
        }
        else{
            echo'*';
        }
    }
    echo '<br>';
}
?>

php program to print hollow triangle star pattern 

Output:-

php program to print hellow triangle star pattern


Related Post :-

 print inverted right half pyramid print php

reverse right half pyramid in php

left pascal star pattern in php

inverted pyramid star pattern in php

print half diamond pattern

print diamond pattern program php

print left half pyramid in php