php语法如何通过输入月份和日期获取个人星座,下面web建站小编给大家简单介绍一下具体实现方法!
示列代码:
function getConstellation($month, $day){ if(($month < 1 || $month > 12) || ($day < 1 || $day > 31)) return false; $constellations = [ ['20' => '水瓶座'], ['19' => '双鱼座'], ['21' => '白羊座'], ['20' => '金牛座'], ['21' => '双子座'], ['22' => '巨蟹座'], ['23' => '狮子座'], ['23' => '处女座'], ['23' => '天秤座'], ['24' => '天蝎座'], ['22' => '射手座'], ['22' => '魔羯座'] ]; list($constellation_key, $constellation_value) = each($constellations[(int)$month - 1]); if($day < $constellation_key){ list($constellation_key, $constellation_value) = each($constellations[($month - 2 < 0) ? $month = 11 : $month -= 2]); } return $constellation_value; } echo getConstellation(5,12); echo getConstellation(1,6);
上面是“php如何通过出生月份日期来计算星座”的全面内容,想了解更多关于 php入门 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_4538.html
workflows工作流
一群蜜蜂和一个六边形蜂巢ComfyUI工作流
一个外国人在吹奏萨克斯ComfyUI工作流
一个巨大的漆黑的蟹王ComfyUI工作流
停在音乐节露营地的一辆复古大众巴士由羊毛制成
文生图工作流:一幅海底睡莲,碧海蓝天comfyui工
海中一头鲸鱼ComfyUI工作流
彩色雄鹰玉雕ComfyUI工作流
森林里一只邪恶的树妖ComfyUI工作流
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!