Skip to content

Instantly share code, notes, and snippets.

@iampaul83
Created April 30, 2015 12:32
Show Gist options
  • Save iampaul83/7769c4362c3979e250aa to your computer and use it in GitHub Desktop.
Save iampaul83/7769c4362c3979e250aa to your computer and use it in GitHub Desktop.
<?php
echo "<table border='1'>";
for ($n=1; $n <=52 ; $n++) {
$array[]=$n;
}
shuffle($array);
for ($i=1; $i <=4 ; $i++) {
switch($i){
case 1:
echo "<tr><td>玩家$i</td>";
for($j = 0; $j < 13; $j++){
echo "<td>",$array[$j],"</td>";
}
echo "</tr>";
break;
case 2:
echo "<tr><td>玩家$i</td>";
for($j=13;$j<26;$j++){
echo "<td>",$array[$j],"</td>";
}
echo "</tr>";
break;
case 3:
echo "<tr><td>玩家$i</td>";
for($j=26;$j<39;$j++){
echo "<td>",$array[$j],"</td>";
}
echo "</tr>";
break;
case 4:
echo "<tr><td>玩家$i</td>";
for($j=39;$j<52;$j++){
echo "<td>",$array[$j],"</td>";
}
echo "</tr>";
break;
}
}
echo "</table>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment