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

  1. <?php
  2. $array = ["Ad1yar","bqtk0vdev","Artemida","NikitaBlack",'Amirka',"Daniluk"];
  3. $teams = [];
  4. $count = 0;
  5. shuffle($array);
  6. foreach($array as $ok){
  7.     $teams[$count/2][] = $ok;
  8.     $count++;
  9. }
  10. $count = 1;
  11. foreach($teams as $team){
  12.     print("Team {$count}: ".implode(" & ", $teams[$count-1])."\n");
  13.     $count++;
  14. }
File Description
  • teamsgen
  • PHP Code
  • 03 Feb-2023
  • 316 Bytes
You can Share it: