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+2; $j++){
  7. if($n!=1){
  8. echo "*";
  9. }
  10.  
  11. }
  12. echo "</br>";
  13. }
  14.  
  15. }
  16.  
  17. $n =5;
  18. printPattern($n);
Success #stdin #stdout 0.02s 25804KB
stdin
5
stdout
                                            *******</br>******</br>*****</br>****</br>***</br>**</br>*</br>