我想回顯6行和6列數字。第一行必須是10-20,下一行20-30等。我想一次回顯6個數字,所以代碼保持清潔有效。有人能引導我走向正確的方向嗎?PHP賓果腳本 - 回顯某些號碼
這是我的代碼至今:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Indzendopdracht 051R3</title>
</head>
<body>
<?PHP
function printBingocard(){
$bingoNumbers = array(
"numbers" => array(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69)
);
$rand_keys = array_rand($bingoNumbers, 1);
foreach($bingoNumbers as $bingoNumbers){
echo "<table border='1'>";
echo "<tr>";
if($bingoNumbers > 10 and < 20){
echo "<td>" . $bingoNumbers[array_rand($bingoNumbers)] . "<br />" . "</td>";
}
else{
echo "";
}
echo "</tr>";
echo "</table>";
}
}
printBingocard();
?>
</body>
</html>
難道我的回答可以幫助您? – KyleK