简易版本一:
<?php
/*** 体彩大乐透模拟机选随机号码* @copyright LUCKY* @author Cfp* @file test.php* @version v.1.0* @date 2018/4/3 19:47**//*** Class LotteryClass* @author Cfp* @$_type int 彩票类型 1 大乐透 2 待定 3 待定* @$_num int 模拟数据组数* @date 2018/6/30 14:58*/
class LotteryClass {public $_type;//1体彩大乐透public $_num;//模拟数据组数function __construct($type='',$num=''){ //初始化对象,将初始化值放在括号内$this->_num=$num;$this->_type=$type;}public function setType($value){$this->_type = $value;}public function setNum($value){$this->_num = $value;}//体彩大乐透public function getLotteryNumberDLT(){$temp_str = '';$temp_arr = array_merge($this->getNoRand(1,35,5),$this->getNoRand(1,12,2));//生成大乐透模拟数据数组foreach($temp_arr as $key => $value){//拼接成数组if($value < 10 ){$temp_value = '0'.$value;//一个数则做前置0处理}else{$temp_value = $value;}if($key == 4){$temp_str .= $temp_value.' + ';}else{$temp_str .= $temp_value.' _ ';}$temp_str .= $temp_value.' _ ';}return trim($temp_str,' _ ');}public function getLotteryNumberDLTArray(){$temp_arr = array_merge($this->getNoRand(1,35,5),$this->getNoRand(1,12,2));//生成大乐透模拟数据数组return $temp_arr;}public function getLotteryNumberDLTArrayMore(){$temp_data = array();if($this->_num){for($i=1;$i<=$this->_num;$i++){$temp_data[$i]= $this->getLotteryNumberDLTArray();}}return $temp_data;}public function getLotteryNumberDLTMore(){$temp_data = array();
//$temp_data['0'] = '体彩大乐透,祝君中奖~';if($this->_num){for($i=1;$i<=$this->_num;$i++){$temp_data[$i]= $this->getLotteryNumberDLT();}}return $temp_data;}protected function getNoRand($begin=0,$end=20,$limit=5){$rand_array=range($begin,$end);shuffle($rand_array);//调用现成的数组随机排列函数$arr_tmp = array_slice($rand_array,0,$limit);sort($arr_tmp);return $arr_tmp;//截取前$limit个}}$Lottery_obj = new LotteryClass(1,5);
//$test_data = $Lottery_obj->getLotteryNumberDLTMore();
$test_data2 = $Lottery_obj->getLotteryNumberDLTArrayMore();//var_dump($test_data2);/*
array (size=6)
0 => string '体彩大乐透,祝君中奖~' (length=31)
1 => string '18 _ 21 _ 02 _ 20 _ 09 + 11 _ 12' (length=34)
2 => string '28 _ 07 _ 18 _ 09 _ 27 + 10 _ 07' (length=34)
3 => string '08 _ 06 _ 12 _ 19 _ 30 + 04 _ 03' (length=34)
4 => string '32 _ 01 _ 26 _ 18 _ 16 + 09 _ 11' (length=34)
5 => string '34 _ 08 _ 21 _ 15 _ 07 + 08 _ 04' (length=34)
*/?>
完善页面版本二:
<?php
/*** 体彩大乐透模拟机选随机号码* @copyright LUCKY* @author Cfp* @file test.php* @version v.1.5* @date  2018/4/3 19:47**//*** Class LotteryClass* @author Cfp* @$_type int 彩票类型 1 大乐透 2 待定 3 待定* @$_num int 模拟数据组数* @date  2018/4/14 13:58*/
class LotteryClass {public $_type;//1体彩大乐透public $_num;//模拟数据组数function __construct($type='',$num=''){ //初始化对象,将初始化值放在括号内$this->_num=$num;$this->_type=$type;}public function setType($value){$this->_type = $value;}public function setNum($value){$this->_num = $value;}//体彩大乐透public function getLotteryNumberDLT(){$temp_str = '';$temp_arr = array_merge($this->getNoRand(1,35,5),$this->getNoRand(1,12,2));//生成大乐透模拟数据数组foreach($temp_arr as $key => $value){//拼接成数组if($value < 10 ){$temp_value = '0'.$value;//一个数则做前置0处理}else{$temp_value = $value;}if($key == 4){$temp_str .= $temp_value.'  +  ';}else{$temp_str .= $temp_value.' _ ';}$temp_str .= $temp_value.' _ ';}return trim($temp_str,' _ ');}public function getLotteryNumberDLTArray(){$temp_arr = array_merge($this->getNoRand(1,35,5),$this->getNoRand(1,12,2));//生成大乐透模拟数据数组return $temp_arr;}public function getLotteryNumberDLTArrayMore(){$temp_data = array();if($this->_num){for($i=1;$i<=$this->_num;$i++){$temp_data[$i]= $this->getLotteryNumberDLTArray();}}return $temp_data;}public function getLotteryNumberDLTMore(){$temp_data = array();//$temp_data['0'] = '体彩大乐透,祝君中奖~';if($this->_num){for($i=1;$i<=$this->_num;$i++){$temp_data[$i]= $this->getLotteryNumberDLT();}}return $temp_data;}protected function getNoRand($begin=0,$end=20,$limit=5){$rand_array=range($begin,$end);shuffle($rand_array);//调用现成的数组随机排列函数$arr_tmp = array_slice($rand_array,0,$limit);sort($arr_tmp);return $arr_tmp;//截取前$limit个}}$Lottery_obj = new LotteryClass(1,5);
//$test_data = $Lottery_obj->getLotteryNumberDLTMore();
$test_data2 = $Lottery_obj->getLotteryNumberDLTArrayMore();//var_dump($test_data2);/*
array (size=6)0 => string '体彩大乐透,祝君中奖~' (length=31)1 => string '18 _ 21 _ 02 _ 20 _ 09  +  11 _ 12' (length=34)2 => string '28 _ 07 _ 18 _ 09 _ 27  +  10 _ 07' (length=34)3 => string '08 _ 06 _ 12 _ 19 _ 30  +  04 _ 03' (length=34)4 => string '32 _ 01 _ 26 _ 18 _ 16  +  09 _ 11' (length=34)5 => string '34 _ 08 _ 21 _ 15 _ 07  +  08 _ 04' (length=34)
*/?><!doctype html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport"content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"><meta http-equiv="X-UA-Compatible" content="ie=edge"><title>体彩大乐透,祝君中奖~</title>
</head>
<style>.btn-primary {width: 100%;margin-top: 5px;margin-bottom: 5px;color: #fff;background-color: #337ab7;text-align: center;border-color: #2e6da4;display: inline-block;padding: 6px 12px;font-size: 14px;font-weight: 400;line-height: 1.42857143;text-align: center;white-space: nowrap;vertical-align: middle;touch-action: manipulation;cursor: pointer;user-select: none;background-image: none;border: 1px solid transparent;border-radius: 4px;font-family: inherit;overflow: visible;}
</style>
<body><div style="padding:0 20px"><table border="1" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><th colspan="7" align="center"><h1 style="color:#3c8dbc;">体彩大乐透,祝君中奖~</h1></th></tr><?php foreach ($test_data2 as $key => $value){ ?><tr align="center"><?php foreach ($value as $k => $v){ ?><?php if ($k == 5 || $k == 6){?><td style="width: 15%;text-align: center"><h3 style="color: red"><?php if ($v <10){echo '0'.$v;}else{echo $v;}?></h3></td><?php }else{?><td><h3 style="width: 15%;text-align: center"><?php if ($v <10){echo '0'.$v;}else{echo $v;}?></h3></td><?php }?><?php }?></tr><?php }?></tbody></table></div>
<br />
<br /><div style="width: 100%;margin: 0 auto;"><div style="width: 40%;margin: 0 auto"><button type="button" class="btn btn-primary"  onclick="replaceDoc()">再选一次</button></div></div>
<!--<a href="http://www.16u.top/index.php" style="text-decoration:none ;font-size:50px;">再选一次</a>--><div style="padding:0 20px;"><div class="help_t_int"><h2>大乐透玩法</h2><p>超级大乐透是指由购买者从01—35共35个号码中选取5个号码为前区号码,并从01—12共12个号码中选取2个号码为后区号码组合为一注彩票进行的基本投注。每注金额人民币2元。</p><p>在本站中,大乐透支持的玩法有:大乐透单式投注,大乐透复式投注,大乐透方案粘贴</p><p><strong></strong></p><p><strong>大乐透单式投注:</strong>由购买者从01—35共35个号码中选取5个号码为前区号码,并从01—12共12个号码中选取2个号码为后区号码,组合为一注彩票进行的基本投注。</p><p class="f_center"><img alt="大乐透玩法_大乐透规则_超级大乐透玩法规则" style="width: 98%" src="http://img5.cache.netease.com/help/2013/5/13/20130513115315a0576.png"></p></div><br><div class="help_t_int"><h2>中奖规则</h2><p class="f_center"><img alt="大乐透玩法_大乐透中奖规则【2014最新】_超级大乐透中奖规则_奖金" style="width: 98%" src="http://img4.cache.netease.com/sports/2014/5/5/20140505211309dffc6.png"><br></p><p>超级大乐透根据投注号码与开奖号码相符情况确定相应中奖资格。具体规定如下:</p><p>一等奖:投注号码与当期开奖号码全部相同(顺序不限,下同),即中奖;</p><p>二等奖:投注号码与当期开奖号码中的5个前区号码及任意1个后区号码相同,即中奖;</p><p>三等奖:投注号码与当期开奖号码中的5个前区号码相同,或者任意4个前区号码及2个后区号码相同,即中奖;</p><p>四等奖:投注号码与当期开奖号码中的任意4个前区号码及任意1个后区号码相同,或者任意3个前区号码及2个后区号码相同,即中奖;</p><p>五等奖:投注号码与当期开奖号码中的任意4个前区号码相同,或者任意3个前区号码及1个后区号码相同,或者任意2个前区号码及2个后区号码相同,即中奖;</p><p>六等奖:投注号码与当期开奖号码中的3个前区号码相同,或者任意1个前区号码及2个后区号码相同,或者任意2个前区号码及任意1个后区号码相同,或者2个后区号码相同,即中奖。</p><p>当期每注投注号码只有一次中奖机会,不能兼中兼得,特别设立奖除外。</p></div></div></body>
</html>
<script>function replaceDoc(){window.location.reload()}
</script>

体彩大乐透模拟机选随机号码_模拟相关推荐

  1. 数组随机取数(大乐透机选投注)

    闲着没事写着完呢 package com.yjl.daletou.util;import java.awt.Color; import java.awt.Dimension; import java. ...

  2. 大乐透机选号码生产器

    1.蓝色球5个,1~35 不能重复 2.红色球2个,1~12 不能重复 代码如下: public class demo {public static void main(String[] args) ...

  3. 用大数据分析预测五组大乐透的开奖号码

    很抱歉,我不能用大数据分析预测五组大乐透的开奖号码.虽然大数据分析可以在某些情况下帮助我们发现模式和趋势,但彩票号码的随机性质使其无法被准确预测.每一期开奖的号码都是独立的,之前的开奖结果不会对下一次 ...

  4. PHP代码来模拟双色球,大乐透机选

    //双色球:红球1-33选6个 蓝球 1-16选一个 $Double_red_array = ['01', '02', '03', '04', '05', '06', '07', '08', '09' ...

  5. 大乐透35选5和12选2

    闲来无事 热身练练手 //-----35选5----- $arr=[]; for($i=1;$i<=35;$i++)$arr[]=$i; // echo count($arr);die; $nu ...

  6. python预测体彩大乐透

    从网上抄了个机器训练的代码,另外自己改了几个数学预测方法 唯一不方便的就是每次要更新数据源然后由于配置太差,每次买之前要提前执行一个钟多,如果间隔时间长的话,手动更新数据也比较繁琐. 这段时间趁着空闲 ...

  7. 自己编一个大乐透选号器

    新手,最近自己尝试着做了一个体彩大乐透的选号器,感觉挺有意思的,下面分享给大家! 具体步骤: 1.新建一个基于对话框的MFC工程. 2.按下图所示添加显示前区号码的5个编辑框,显示后区号码的2个编辑框 ...

  8. python大乐透号码生成器_国庆长假写了个体彩大乐透彩票号码生成器小程序

    国庆假期,除了带娃,就是回复客人和工厂邮件,还有看书了. 带娃大家都懂得,惨绝人寰,(好吧,女儿还是挺可爱的,但是精力太充沛了,自愧不如啊)比起来工作和看书就是天堂了... 不过假期有点长,后面几天思 ...

  9. 大乐透号码随机生成与排序

    前面两篇介绍了两个非常简单的排序算法,本篇介绍排序算法的一个简单应用--对大乐透随机号码进行排序. 由于工作中涉及很多前端的开发,所以对前端技术有一定了解,前端的一个好处是可以直观地看到页面的布局.每 ...

  10. 大乐透python预测程序_Python生成随机验证码,大乐透号码

    随机生成验证码 示例代码: import random # 导入标准模块中的random if __name__ == '__main__': check_code = "" # ...

最新文章

  1. MySQL 插入数据时,中文乱码问题的解决
  2. Windows进程间通信的各种方法
  3. 【干货分享】云服务平台的架构及优势(上)
  4. flink on yarn HA高可用集群搭建
  5. python telnetlib执行命令_使用python Telnet远程登录执行程序的方法
  6. Spring入门篇——第6章 Spring AOP的API介绍
  7. C++学习之路 | PTA乙级—— 1084 外观数列 (20 分)(精简)
  8. WorkFlow入门Step.7—Creating a FlowChart WorkFlow-For-WF4.0
  9. 变结构滑模控制抖振处理(1)------动态滑模法
  10. sizeo(结构体)的问题
  11. ScriptManager的EnablePageMethods
  12. UE5 C++教程(三、多人游戏网络基础)
  13. 安卓桌面壁纸_苹果iPhone全面屏桌面壁纸 第88期 苹果x手机专用高清壁纸
  14. 银行排队问题(详解队列)
  15. WhatsApp的下载与更新
  16. 禁止在input中输入中文
  17. 十大老牌黑客之:米特尼克
  18. DOS命令操作大全和计算机运行命令(初次写请多多关照)
  19. 从0开始教你三天完成毕业设计-项目设计
  20. Yandex的源代码

热门文章

  1. postman批量测试成功newman生成测试报告失败
  2. iOS 测试app提示不受信任的开发者
  3. ASDM的网管的环境搭建
  4. 机器学习导论(一)绪论
  5. 利用ADS 2019软件Designguide自动设计滤波器
  6. 抽奖活动mysql表设计_抽奖项目的系统设计方案
  7. 版本控制工具-Git
  8. kindle刷机ttl_摔一下变砖了,ttl刷机没效果,谁帮看看最后三行那个error什么意...
  9. JspStudy环境下tomcat服务器无法正确运行servlet的一种解决方法
  10. 配置修改Tomcat端口