fork download
  1. <?php
  2.  
  3. // your code goes here
  4. function printPattern($n){
  5. for($i=1; $i<=$n+2; $i++){
  6. for($j=$i; $j<=$n; $j++){
  7. echo "*";
  8. }
  9. }
  10. echo "</br>";
  11. }
  12.  
  13. $n =3;
  14. printPattern($n);
Success #stdin #stdout 0.04s 25340KB
stdin
3
stdout
        ******</br>