首页 > 代码库 > 创建星宿与生日对照的数组
创建星宿与生日对照的数组
$file = 'xingxiu.php'; $xx = array( 0=>array('id'=>13,'xingxiu'=>'室宿'), 1=>array('id'=>14,'xingxiu'=>'壁宿'), 2=>array('id'=>15,'xingxiu'=>'奎宿'), 3=>array('id'=>16,'xingxiu'=>'娄宿'), 4=>array('id'=>17,'xingxiu'=>'胃宿'), 5=>array('id'=>18,'xingxiu'=>'昴宿'), 6=>array('id'=>19,'xingxiu'=>'毕宿'), 7=>array('id'=>20,'xingxiu'=>'觜宿'), 8=>array('id'=>21,'xingxiu'=>'参宿'), 9=>array('id'=>22,'xingxiu'=>'井宿'), 10=>array('id'=>23,'xingxiu'=>'鬼宿'), 11=>array('id'=>24,'xingxiu'=>'柳宿'), 12=>array('id'=>25,'xingxiu'=>'星宿'), 13=>array('id'=>26,'xingxiu'=>'张宿'), 14=>array('id'=>27,'xingxiu'=>'翼宿'), 15=>array('id'=>28,'xingxiu'=>'轸宿'), 16=>array('id'=>1,'xingxiu'=>'角宿'), 17=>array('id'=>2,'xingxiu'=>'亢宿'), 18=>array('id'=>3,'xingxiu'=>'氐宿'), 19=>array('id'=>4,'xingxiu'=>'房宿'), 20=>array('id'=>5,'xingxiu'=>'心宿'), 21=>array('id'=>6,'xingxiu'=>'尾宿'), 22=>array('id'=>7,'xingxiu'=>'箕宿'), 23=>array('id'=>8,'xingxiu'=>'斗宿'), 24=>array('id'=>10,'xingxiu'=>'女宿'), 25=>array('id'=>11,'xingxiu'=>'虚宿'), 26=>array('id'=>12,'xingxiu'=>'危宿'), ); $num = 0; for($i=1;$i<13;$i++){ for($j=1;$j<31;$j++){ if(($num%30==0&&$j==1)&&$i==2){ $num = $num-1; }else if(($num+$i-2)%30==0&&$j==1&&$i>2&&$i<7){ $num = $num-1; }else if(($num+$i-4)%30==0&&$j==1&&$i>8&&$i<11){ $num = $num-1; }else if(($num+$i-5)%30==0&&$j==1&&$i>11){ $num = $num-1; } $xingxiu[$i][$j]['id'] = $xx[$num%27]['id']; $xingxiu[$i][$j]['xingxiu'] = $xx[$num%27]['xingxiu']; $num++; } } export_to_file($file,$xingxiu);//<a target=_blank target="_blank" href=http://www.mamicode.com/"http://blog.csdn.net/hearain528/article/details/40144427">该函数见上一篇博客>创建星宿与生日对照的数组
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。