首页 > 编程语言 >PHP奇门遁甲排盘代码片段

PHP奇门遁甲排盘代码片段

时间:2022-11-16 02:33:38浏览次数:64  
标签:排盘 Id diArray 奇门遁甲 array PHP shenArray Pan xu

功能演示 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

相关文章

  • PHP实现公历转节气
    privatefunctionJieqiList($Year){//echo$Year;$year=substr($Year,-2)+0;$coefficient=array(......
  • 【Redis】PHP操作Redis的命令大全
    1、连接到redis服务<?php//连接本地的Redis服务$redis=newRedis();$redis->connect('127.0.0.1',6379);echo"Connectiontoserversucessfully";//设置redis......
  • PHP可以用来做什么
    PHP是一种通用开源脚本语言。语法吸收了C语言、Java和Perl的特点,利于学习,使用广泛,主要适用于Web开发领域。实际上PHP能做任何事。PHP主要是用于服务端的脚本程序,因此可......
  • PHP常用函数
    PHP常用函数总结数学函数1.abs():求绝对值$abs=abs(-4.2);//4.2数字绝对值数字2.ceil():进一法取整echoceil(9.999);//10浮点数进一取整3.floor():舍去法......
  • php抽奖概率算法(刮刮卡,大转盘)
    参考:https://www.jb51.net/article/87242.htm本文实例为大家分享了php中奖概率算法,可用于刮刮卡,大转盘等抽奖算法,用法很简单,代码里有详细注释说明,供大家参考,具体内容如下......
  • 宝塔面板PHP7.3 安装mcrypt扩展
    mcrypt扩展从PHP7.1.0开始废弃,所以需要继续使用这个扩展的话需要自行编译mcrypt扩展或者采用pcel安装。yuminstalllibmcryptlibmcrypt-develmcryptmhashw......
  • PHP获取真实IP地址(获取本地127.0.0.1真实地址)
    PHP获取真实IP地址publicfunctionget_real_ip(){static$realip;if(isset($_SERVER)){if(isset($_SERVER['HTTP_X_FORWARDED_......
  • php 导出图片为pdf
    require_onceROOTPATH.'tcpdf/vendor/autoload.php';$html='';if($html){mpdf($html);}else{echo"下载失败,请选择资源";die();}functionmPdf($htm......
  • PHP YouTube字幕转srt格式
     <?phpfunctionformatNum(int$time){if($time<10){return"0{$time}";}return$time;}functionchangeTimeType(int$num):string......
  • PHP二分法
    classHalfFind{/***@desc二分法查找效率老高了前提:必须是有序的数组*@desc二分法时间复杂度为O(logn)**@param$nums*......