PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $teams=[1,2,3]; $randTeams = $teams; shuffle($randTeams); shuffle($teams); $i = 3; $str=''; foreach ($randTeams as $team) { foreach ($teams as $t) { if ($team != $t) { $str.="$i $team - $t<br>"; $i++; } } } $arr=explode("<br>",$str); shuffle($arr); print_r($arr);
Show:  
Copy Clear