42 - 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 42.php

  1. <?php
  2. /*public class Combination {
  3.  
  4.  
  5.     static void combinations2(array[] $arr, int $len, int $startPosition, array $result):void{
  6.         if ($len == 0){
  7.             print_r($result);
  8.             return;
  9.         }       
  10.         for ( $i = $startPosition; $i <= $arr-len; i++){
  11.             $result[sizeOf($result) - len] = arr[i];
  12.             combinations2(arr, len-1, i+1, result);
  13.         }
  14.     }       
  15. }
  16. */
  17.  
  18. $arr = ["A","B","C","D","E","F"];
  19.  
  20. print_r($arr);
  21.  
  22. $comb=new Combination();
  23. /*
  24. $comb->combinations2(arr, 3, 0, new String[3]);
  25.  
  26.  
File Description
  • 42
  • PHP Code
  • 16 Apr-2022
  • 544 Bytes
You can Share it: