Winning lottery numbers generator
01/04/2008 8:34 PM
I won £10 on the lottery last Saturday, so as a light hearted second post I am sharing with you the code that generated the winning numbers (also to test code highlighting in Wordpress).
$lottery = array();
while (count($lottery) < 6)
{
$number = rand(1,49);
if (!in_array($number, $lottery))
{
$lottery[] = $number;
}
}
echo implode(', ', $lottery);











