task 1 - 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 task 1.php

  1. <?php
  2. function sum($a, $b) {
  3.         $sum = 0;
  4.         for($i = $a; $i<=$b; $i++) {
  5.                 if (!($i%2)) $sum += $i;
  6.         }
  7.         return $sum;
  8. }
  9.  
  10. sum(11, 111);
File Description
  • task 1
  • PHP Code
  • 29 Sep-2023
  • 130 Bytes
You can Share it: