php 采集彩票双色球数据与简单统计
采集彩票双色球数据与简单统计 采集彩票双色球数据与简单统计采集彩票双色球数据,以及分析彩票双色球数据,采集与统计实例详情:采集彩票双色球数据与简单统计_PHP_WO就爱_WO就爱
采集彩票双色球数据与简单统计采集彩票双色球数据,以及分析彩票双色球数据,采集与统计实例详情:采集彩票双色球数据与简单统计_PHP_WO就爱_WO就爱我的博客 由于上传文件时,只能上传utf-8编码的文件(不然中文乱码),可以会在试用时有乱码
采集开彩票双色球数据,以及分析彩票双色球数据--采集与统计实例 ~ 4KB 下载(53)
<?php
/*
* 采集开彩票双色球数据,以及分析彩票双色球数据--采集与统计实例
*/
ini_set('display_errors', 0);//是否显示PHP错误信息,1显,0不显
require('caipiao.php');
$Ss = new getSseqiu();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> 采集与统计 </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<input type="button" value="采集" onclick="document.location.href='?action=caiji'" />
<form method="get" action="?">
期数<input type="text" name="qishu" value="<?=$qishu?>"/>
期差<select name="cha">
<option value="5" <?=$chas5?>>5</option>
<option value="10" <?=$chas10?>>10</option>
<option value="15" <?=$chas15?>>15</option>
<option value="20" <?=$chas20?>>20</option>
</select>
<input type="submit" value="确定"/>
</form>
<?php
if(isset($_GET['action']) && $_GET['action'] == 'caiji'){
// 采集数据
$start = 1; //开始页
$end = 43; //结束页
if($Ss->main($start, $end)){
echo '采集完成';
}
}else{
$qishu = isset($_GET['qishu']) ? intval($_GET['qishu']) : 0;
$cha =isset($_GET['cha']) ? intval($_GET['cha']) : 0;
$chas = 'chas'.$cha;
$$chas = 'selected="selected"';
if($_GET){
$_list = $Ss->detachNum();
$list = array();
$n = $i = $qishu;
$num_arr = array();
for( $i; $i <= $qishu+$cha; $i++ ){
$num_arr[] = $i;
}
for( $n; $n >= $qishu-$cha; $n-- ){
if(!in_array($n, $num_arr))
$num_arr[] = $n;
}
sort($num_arr);
$list = array();
foreach($num_arr as $key => $val){
$list[] = $_list[$val];
}
$dispose = $Ss->dataDispose( $list, $qishu);
$red = $dispose['red'];
$blue = $dispose['blue'];
?>
<table width="20%" style="float:left; text-align:center;">
<tr>
<td width="80px" height="25px">期数</td>
<td width="180px">红</td>
<td width="50px">蓝</td>
</tr>
<?php
foreach($list as $key => $val){
$style = '';
if($val[0]==$qishu){
$style="style='background: #EBE6A9;'";
}
?>
<tr <?=$style?>>
<td height="25px"><?=$val[0]?></td>
<td><?=$val[1]?></td>
<td><?=$val[2]?></td>
</tr>
<?php
}
?>
</table>
<table width="20%" style="float:right;text-align:center;">
<tr>
<td width="30px" height="25px">红</td>
<td width="30px">次数</td>
<td width="30px">权值</td>
<td width="30px">均值</td>
</tr>
<?php
for($i=1;$i<=33 ;$i++ ){
?>
<tr>
<td height="25px"><?=$i?></td>
<td class="hits"><?=$red[$i]['hits']?></td>
<td class="weight"><?=$red[$i]['weight']?></td>
<td class="mean"><?=$red[$i]['mean']?></td>
</tr>
<?php
}
?>
</table>
<table width="20%" style="float:right; text-align:center;">
<tr>
<td width="30px" height="25px">蓝</td>
<td width="30px"><a href="javascript:void(0);" onclick="orderBy('blue_son','hits')">次数</a></td>
<td width="30px">权值</td>
<td width="30px">均值</td>
</tr>
<?php
for($i=1;$i<=16 ;$i++ ){
?>
<tr class="blue_son">
<td><?=$i?></td>
<td class="hits"><?=$blue[$i]['hits']?></td>
<td class="weight"><?=$blue[$i]['weight']?></td>
<td class="mean"><?=$blue[$i]['mean']?></td>
</tr>
<?php
}
?>
</table>
<script language="javascript">
<!--
function orderBy(son,ob){
var obj_son = $('.'+son);
var obj_ob = $('.'+ob);
obj.each(function (){
$(this).next('.'+ob).html();
});
}
//-->
</script>
<?php
}
?>
<?php
}
?>
</body>
</html>
精彩图集
精彩文章






