Blogger Information
Blog 22
fans 0
comment 0
visits 17738
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0107双色球开奖
yestrue的博客
Original
625 people have browsed it
<?php

/**
 * 
 */
//创建1-33的红球数组
$red = range(1,33);
//随机取出6个红球
$temp = array_rand($red,6); //由小到大的

//打乱红球的顺序
shuffle($temp);
// print_r($temp); Array ( [0] => 6 [1] => 26 [2] => 18 [3] => 4 [4] => 24 [5] => 15 )
//给取出的数字加前导0
foreach ($temp as $v) {
$redBall []= $red[$v]>=10?$red[$v]:'0'.$red[$v];
}
// print_r($redBall);
// 生成随机蓝球
$blue = mt_rand(1,16);

// 给蓝球加前导零
$blueBall = $blue>=10?$blue:'0'.$blue;

?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>

</head>
<body>
<div>
<div>
<div>


<h2 >双色球摇奖</h2>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<div>
<?php 
foreach ($redBall as $key => $value) {
echo "<span style='color:red'>{$value}&nbsp;&nbsp;</span>";
}
echo "<span style='color:blue'>{$blueBall}&nbsp;&nbsp;</span>";

?>
</div>
<br>
   <button type="submit">开奖</button>
   
</form>

</div>
</div>
</div>
</body>
</html>

0107.png

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post