php program print diamond number pattern

 

php program print diamond number pattern

php program print diamond number pattern 

Example :-

<?php
echo "<pre>";
for($i=1;$i<8;$i++)
{
    for($j=$i; $j<8;$j++)
    echo "&nbsp;&nbsp;";
for($j=2*$i-1;$j>0;$j--)
echo("&nbsp;1");
echo"<br>";
}
$n =8;
for($i=8;$i>0;$i--){
    for($j=$n-$i;$j>0;$j--)
    echo "&nbsp;&nbsp;";
 for($j=2*$i-1;$j>0;$j--)
 echo ("&nbsp;1");
echo "<br>";

}
echo"</pre>";
?>

php program print diamond number pattern 

Output :-

php program print diamond number pattern
Related Post :-

how to set background image html table

what is the html frame tag

html tag

Comments

Popular posts from this blog

HTML Tag

CSS Text Color Explained with Syntax and HTML Examples

HTML Input Type Submit Syntax and Example