php program to print heart star pattern
php program to print heart star pattern
Example:-
<?php
$size =6;
for($i=$size/2;$i<$size;$i+=2)
{
for($j=1;$j<$size-$i;$j+=2)
{
echo " ";
}
for($j=1;$j<$i+1;$j++)
{
echo '*';
}
for($j=1;$j<$size-$i+1;$j++)
{
echo " ";
}
for($j=1;$j<$i+1;$j++)
{
echo "*";
}
echo '<br>';
}
for($i=$size;$i>0;$i--)
{
for($j=0;$j<$size-$i; $j++)
{
echo " ";
}
for($j=1;$j<$i*2;$j++)
{
echo '*';
}
echo "<br>";
}
?>
php program to print heart star pattern
Output :-
Post a Comment