编辑代码

<?php
//------------------------>位邻和振幅
//百十个的走势图振幅为 邻和振幅时候---->可杀!!!
$formula = array(
    "0 ",
    "1 ",
    "2 ",
    "3 ",
    "4 ",
    "5 ",
    "6 ",
    "7 ",
    "8 ",
    "9 ",
    "10",
    "11",
    "12",
    "13",
    "14",
    "15",
    "16",
    "17",
    "18",
    "振幅",
    "0 ",
    "1 ",
    "2 ",
    "3 ",
    "4 ",
    "5 ",
    "6 ",
    "7 ",
    "8 ",
    "9 "
);



$numbers = [
            "657","292","703","916","214",
            "634","085","898","141","260",
            "416","333","518","487","606",
            "679","942","104","027","836",
            "710","056","468","638","591",
            "762","486","588","383","409",
            "096","302","379","499","606",
            "261","778","617","131","847",
            "932","428","401","772","475",
            "912","554","490","248","640",
            "004","806","905","585","895",
            "497","368","492","397","405",
            "847","938","476","810","405",
            "928","538","720","385","555",
            "906","748","434","272","778",
            "419","709","781","625","000",
            "657","500","403","417","915",
            "030","338","388","826","022",
            "658","159","135","317","545",
            "649","068","385","542","714",
            "707","953","016","161","370",
            "877","015","752","027","407",
            "841","914","270","954","635",
            "375","206","320","849","621",
            "315","912","120","488","725",
            "809","351","320","431","814",
            "915","204","203","689","645",
            "748","458","113","838","296",
            "598","149","202","916","256",
            "666","267","897","321","838",
            "734","321","718","210","069",
            "923","499","775"

];



function zuSan($accnum){
    $tmpArr = array($accnum[0], $accnum[1], $accnum[2]);
    $tArray = array_unique($tmpArr);
    if(count($tArray) == 3){
        return false;    
    }
    return true;    
}

function zhenFu($lastacc, $accnum, $nextnum){
    $num0 = $lastacc + $accnum;
    $num1 = $accnum + $nextnum;
    $zf = abs($num1 - $num0); 
    if($zf > 9){
        $zf = $zf % 10;
    }
    return $zf;    
}



function weiZhiB($index){
    $msg = "";
    $index = $index;
    for($i=0;$i<19;$i++){
        if($index == $i){
            $msg = $msg . '<td style="background-color: green;">' . $i  .  '</td>';
        }else{
            $msg = $msg . "<td></td>";
        }
    }
    
    return $msg;
}

function weiZhi($index){
    $msg = "";
    $index = $index;
    for($i=0;$i<10;$i++){
        if($index == $i){
            $msg = $msg . '<td style="background-color: green;">' . $i  .  '</td>';
        }else{
            $msg = $msg . "<td></td>";
        }
    }
    
    return $msg;
}


for($x=0;$x<3;$x++){
    echo '<table width="700" height="100" border="1" cellpadding="0" cellspacing="0">';
        // 3. 输出表头
    $name = "";
    if($x==0){
        $name = "百位";
    }else if($x==1){
        $name = "十位";
    }else if($x==2){
        $name = "个位";
    }
    echo '<thead><tr><th>' . $name .  '   开奖号' . '</th>';
    foreach ($formula as $item){
        echo '<th>' . $item . '</th>';
    }
    echo '</tr></thead>';
    // 4. 输出表格内容
    echo '<tbody>';
    $length = count($numbers);
    for ($i=0;$i<$length;$i++){
        //5. 输出一行数据
        echo '<tr>';
        echo '<td>' . $numbers[$i] . '</td>';
        if($i<=1){
            continue;
        }
        $outputMsg =  weiZhiB($numbers[$i-1][$x]+$numbers[$i][$x]);
        echo $outputMsg;

        if($i > 0){
            echo '<td></td>';
            $zf = zhenFu($numbers[$i-2][$x],$numbers[$i-1][$x],$numbers[$i][$x]);
            $outputMsg1 =  weiZhi($zf);
            echo $outputMsg1;
        }

        echo '</tr>';
    }
    echo '</tbody>';
    echo '</table>';
    echo "\n";
    echo "\n";
    echo "\n";
    echo "\n";
    echo "\n";
    echo "\n";


}




echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
?>