功能演示 http://h5.zhoulegeyi.com/?module=table&page=a_qimen
这里主要演示以下如何实现转盘
private function Shenpan($dun,$zhifugong)
{
$panxu=array(1,8,3,4,9,2,7,6,1,8,3,4,9,2,7,6);
$dp=0; $diArray=array(); foreach($panxu as $xu)
{ //地盘 if($xu==$zhifugong) { $dp=1; }
if($dp==1&&count($diArray)<8)
{ array_push($diArray,$xu); } }
$yinArray=array(1,8,7,6,5,4,3,2);
$yangArray=array(1,2,3,4,5,6,7,8);
$shenArray=$yinArray;
if($dun==1)
{ $shenArray=$yangArray; }
for($i=0;$i<8;$i++)
{ $this->Pan[$diArray[$i]]['Shen_Id']=$this->Pan[$shenArray[$i]]['Gong_Id'];
$this->Pan[$diArray[$i]]['Shen_Key']=FyQmBashenKey($this->Pan[$shenArray[$i]]['Gong_Id']);
$this->Pan[$diArray[$i]]['Shen_Name']=FyQmBashenName($this->Pan[$shenArray[$i]]['Gong_Id']);
} }
标签:排盘,Id,diArray,奇门遁甲,array,PHP,shenArray,Pan,xu From: https://www.cnblogs.com/zhoulegeyi/p/16894604.html