Created
October 24, 2017 17:09
-
-
Save ivoo77/e151dba30c853bdf914764c160f7883c to your computer and use it in GitHub Desktop.
PHP script for random 6 lottary numbers from 1 to 49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//script for random 6 lottary numbers from 1 to 49. | |
$lottoarray = array(); | |
for($i=1;$i<=6;$i++){ | |
do{ | |
$random = random_int(1, 49); | |
}while (in_array($random, $lottoarray)); | |
$lottoarray[] = $random; | |
} | |
for($j=0;$j<6;$j++){ | |
$val=$lottoarray[$j]; | |
echo '<h1>',$j+1,' Number - ',$val,'</h1>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment