christmasstree - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of christmasstree.php

  1. <?php
  2.  
  3. echo "<center>";
  4. $adim=1;
  5. for($i=1;$i<=35;$i++)
  6. {
  7. for($k=1;$k<=$adim;$k++)
  8. {
  9. echo "*";
  10.        
  11. }
  12.         $adim++;
  13.         echo "<br>";
  14.         if($i%5==0)
  15.         {
  16.         $adim=$adim-3;
  17.         }
  18. }
  19. for($j=1;$j<=10;$j++)
  20. {
  21. echo "***<br>";
  22. }
File Description
  • christmasstree
  • PHP Code
  • 05 Sep-2019
  • 200 Bytes
You can Share it: