Home > Backend Development > PHP Tutorial > 福利彩票幸运号码自动生成器

福利彩票幸运号码自动生成器

WBOY
Release: 2016-06-01 14:30:12
Original
3020 people have browsed it
采用php完全随机设计,每次刷新都有不同幸运号码,试试看,发了财别忘了neo哦~~~ 
for ($n=1;$n echo "第".$n."注 "; 
$string="";//初始化字符串 
for ($i=1;$i mt_srand((double)microtime()*1000000);//加入时间的因素,以执行时的百万分之一秒当乱数种子 
$random=mt_rand(1,30);//产生1-30间的随机数 
if (eregi($random,$string)){//检查此数是否已经存在 
$i--; 
continue;//跳出循环,回到判断起始处。 
} 
else{ 
$string=$string.",".$random; 
echo $random," ";} 
} 
echo "
"; 
} 
?>
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template