php program to print half diamond pattern

 php program to print half diamond pattern

php program to print half diamond  pattern

php program to print half diamond  pattern

Example :-

<?php
for($i=5;$i>=1;$i--)
{
    if($i%2!=0)
    {
        for($j=5;$j>=$i;$j--)
        {
        echo "*";

    }
  echo"<br>";
}
}
for($i=2;$i<=5;$i++)
{
    if($i%2!=0)
    {
        for($j=5;$j>=$i;$j--)
        {
            echo "*";
        }
        echo "<br>";
    }
}
?>

php program to print half diamond  pattern

Output:-

php program to print half diamond  pattern



Related Post :-

php program to print triangle pattern

php array types

Comments

Popular posts from this blog

What Is CSS Text Color in 2026

CSS Padding Property Explained

CSS Outline Color Property in 2026