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