<html>
<head>
<title>Lotto</title>
</head>
<body>
<h1>De Winnende Lotto-getallen</h1>
<?php
// array lotto
$lottonummers = range (1,42);
shuffle($lottonummers);
echo "<strong><u>De winnende nummers zijn:</u></strong><br /><br /> \n";
for($i=0; $i<6;$i++)
{
echo "Nr: " . ($i+1) . ": " . "<strong>".$lottonummers[$i]."</strong>" . "<br> \n";
$lottokleur[$lottonummers[$i]-1]="green";
}
echo "<br />";
echo "<strong><u>Het reserve getal is:</u></strong> \n" . $lottonummers[41];
// Array RESERVEGETAL Tabel 1
$lottokleur[$lottonummers[41]-1]="red";
echo "<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" style=\"border: 3px solid black\"> \n";
for ($y=0;$y<6;$y++)
{
echo "<tr> \n";
for ($x=0;$x<7;$x++)
{
echo "<td bgcolor=" . $lottokleur[($y*7)+ $x] . ">" . (($y*7) + $x+1) . "</td> \n";
}
echo "</tr>";
}
echo "</table>";
?>
</body>
</html>
<html>
<head>
<title>Lotto</title>
</head>
<body>
<h1>De Winnende Lotto-getallen</h1>
<?php
// array lotto
$lottonummers = range (1,42); echo "<strong><u>De winnende nummers zijn:</u></strong><br /><br /> \n"; for($i=0; $i<6;$i++)
{
echo "Nr: " . ($i+1) . ": " . "<strong>".$lottonummers[$i]."</strong>" . "<br> \n"; $lottokleur[$lottonummers[$i]-1]="green";
}
echo "<strong><u>Het reserve getal is:</u></strong> \n" . $lottonummers[41]; // Array RESERVEGETAL Tabel 1
$lottokleur[$lottonummers[41]-1]="red";
echo "<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" style=\"border: 3px solid black\"> \n"; for ($y=0;$y<6;$y++)
{
for ($x=0;$x<7;$x++)
{
echo "<td bgcolor=" . $lottokleur[($y*7)+ $x] . ">" . (($y*7) + $x+1) . "</td> \n"; }
}
?>
</body>
</html>