PHP Lotto Number Generator

If you want to try different approach for playing lotto, this is the solution


function lotto($broj = 6, $red = 8, $min = 1,$max = 42)
{
srand((double)microtime()*1234567);
	for($i=1;$i<=$red;$i++){
			for($b=1;$b<=$broj;$b++){
			echo rand($min,$max)." ";
		}
	echo "";
	}
}


Call it by just typing lotto();
You can set parameters $broj (number of numbers ), $red (number of rows), $min and $max are self explaining.
Example:


5 25 25 38 14 18 
33 12 4 10 28 24 
1 30 23 7 9 4 
13 4 10 2 11 33 
9 36 12 10 31 8 
29 38 37 13 14 32 
10 37 24 11 39 8 
10 17 22 37 28 26 


Now go and play that ticket
©2009-2011 Webarto • web design & development • Tuzla // Sarajevo // Beograd