PHP Sandbox Example - 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 PHP Sandbox Example.php

  1. <?php
  2.  
  3. foreach (range(0, 100) as $number_current) {
  4.     $string_output = "";
  5.  
  6.     if ($number_current % 3 == 0) { // check if current number in the loop is divisibled by 3;
  7.         $string_output .= "Hello\n";
  8.     }
  9.  
  10.     if ($number_current % 5 == 0) { // check if current number in the loop is divisibled by 5;
  11.         $string_output .= "World\n";
  12.     }
  13.  
  14.     // print the values
  15.     echo $string_output; 
  16. }
  17.  
File Description
  • PHP Sandbox Example
  • PHP Code
  • 08 May-2023
  • 424 Bytes
You can Share it: