How to make star pyramid with php

  • 0
<?php
  $length = 3;
  for($a = 0; $a <= $length; $a++) {
    for($b = $length; $b >= $a; $b--) {
      echo "&nbsp";
    }

    for($c = 0; $c <= $a; $c++) {
      echo "*";
    }

    echo "< br />";
  }
?>

No comments:

Post a Comment