采用php完全随机设计,每次刷新都有不同幸运号码,试试看,发了财别忘了neo哦~~~
<?php
for ($n = 1; $n <= 5; $n) {
echo "第" . $n . "注 ";
$string = ""; //初始化字符串
for ($i = 1; $i <= 7; $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 "<BR>";
}文章链接:
随便收藏,请保留本文地址!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号