实训项目:PHP双色球效果实现

您所在的位置:网站首页 web实训项目故宫轮播图 实训项目:PHP双色球效果实现

实训项目:PHP双色球效果实现

2024-06-18 19:29| 来源: 网络整理| 查看: 265

实验步骤

1.创建一个1-33的红色球号码区数组,并随机取出6个号码; 2.创建一个1-16的蓝色球号码区数组,并随机取出1个号码; 3.显示输出机选的红色球号码和蓝色球号码。

运行效果  html,css代码 .box1 { width: 820px; height: 200px; /* border: 2px dashed #000; */ margin: 0 auto; /* background-color: #ddd; */ } h1 { text-align: center; margin-bottom: 50px; margin-top: 30px; } button { float: right; width: 100px; height: 40px; margin-top: 30px; font-size: 16px; color: #fff; cursor:hand; background-color: #000000; } button:hover { background-color: white; color: #000; transition: .8s; } .bb/* 蓝球样式 */ { display: inline-block; background: blue; border-radius: 100%; height: 100px; width: 100px; text-align: center; line-height: 100px; font-size: 50px; color: #fff; font-weight: bold; background: radial-gradient(circle at 70% 30%,blue 0%,black 120%); } .rb/* 红球样式 */ { display:inline-block; background: red; border-radius: 100%; height: 100px; width: 100px; text-align: center; line-height: 100px; font-size: 50px; color:#fff; font-weight: bold; margin-right: 20px; background: radial-gradient(circle at 70% 30%,red 0%,black 120%); } 双色球效果实现 php代码 PHP range() 函数

range() 函数创建一个包含指定范围的元素的数组。

PHP array_rand() 函数

array_rand() 函数返回数组中的随机键名,或者如果您规定函数返回不只一个键名,则返回包含随机键名的数组。

PHP shuffle() 函数

shuffle() 函数把数组中的元素按随机顺序重新排列。

PHP rand() 函数

rand() 函数返回随机整数。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3