PHP Program to print Diamond Star Pattern
belongs to collection: All star pattern programs in PHP
All Answers
need an explanation for this answer? contact us directly to get an explanation for this answer
need an explanation for this answer? contact us directly to get an explanation for this answer
need an explanation for this answer? contact us directly to get an explanation for this answer
<?php
for($i=0;$i<=5;$i++){
for($k=5;$k>=$i;$k--){
echo " ";
}
for($j=1;$j<=$i;$j++){
echo "* ";
}
echo "<br>";
}
for($i=4;$i>=1;$i--){
for($k=5;$k>=$i;$k--){
echo " ";
}
for($j=1;$j<=$i;$j++){
echo "* ";
}
echo "<br>";
}
?>
need an explanation for this answer? contact us directly to get an explanation for this answer
total answers (2)