Home >Backend Development >PHP Tutorial >Welfare Lottery Double Color Ball Lottery Trend Chart Welfare Lottery Lucky Number Automatic Generator

Welfare Lottery Double Color Ball Lottery Trend Chart Welfare Lottery Lucky Number Automatic Generator

WBOY
WBOYOriginal
2016-07-29 08:33:4218326browse

It is completely randomly designed using PHP. Each time it is refreshed, there will be different lucky numbers. Give it a try and don’t forget neo when you get rich~~~
for ($n=1;$n<=5;$n++ ) {
echo "No.".$n."Note";
$string="";//Initialization string
for ($i=1;$i<=7;$i++) {
mt_srand((double )microtime()*1000000);//Add the time factor to use the millionth of a second during execution as the random number seed
$random=mt_rand(1,30);//Generate a random number between 1-30
if (eregi($random,$string)){//Check whether this number already exists
$i--;
continue;//Jump out of the loop and return to the starting point of judgment.
}
else{
$string=$string.",".$random;
echo $random," ";}
}
echo "
";
}
?>

The above introduces the Welfare Lottery Double Color Ball Lottery Trend Chart and the Welfare Lottery Lucky Number Automatic Generator, including the content of the Welfare Lottery Double Color Ball Lottery Trend Chart. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn