本篇内容主要讲解“php怎么根据日期显示所在星座”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“php怎么根据日期显示所在星座”吧!
创新互联自2013年起,先为柳江等服务建站,柳江等地企业,进行企业商务咨询服务。为柳江企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。本文实例讲述了php根据日期显示所在星座的方法。分享给大家供大家参考。具体实现方法如下:
22 || $day < 21)){ $zodiac = "Aries"; } elseif(($month == 4 || $month == 5) && ($day > 22 || $day < 22)){ $zodiac = "Taurus"; } elseif(($month == 5 || $month == 6) && ($day > 23 || $day < 22)){ $zodiac = "Gemini"; } elseif(($month == 6 || $month == 7) && ($day > 23 || $day < 23)){ $zodiac = "Cancer"; } elseif(($month == 7 || $month == 8) && ($day > 24 || $day < 22)){ $zodiac = "Leo"; } elseif(($month == 8 || $month == 9) && ($day > 23 || $day < 24)){ $zodiac = "Virgo"; } elseif(($month == 9 || $month == 10) && ($day > 25 || $day < 24)){ $zodiac = "Libra"; } elseif(($month == 10 || $month == 11) && ($day > 25 || $day < 23)){ $zodiac = "Scorpio"; } elseif(($month == 11 || $month == 12) && ($day > 24 || $day < 23)){ $zodiac = "Sagittarius"; } elseif(($month == 12 || $month == 1) && ($day > 24 || $day < 21)){ $zodiac = "Cpricorn"; } elseif(($month == 1 || $month == 2) && ($day > 22 || $day < 20)){ $zodiac = "Aquarius"; } elseif(($month == 2 || $month == 3) && ($day > 21 || $day < 21)){ $zodiac = "Pisces"; } return $zodiac; } echo zodiac('1986-07-22'); //Valid strtotime date ?>
到此,相信大家对“php怎么根据日期显示所在星座”有了更深的了解,不妨来实际操作一番吧!这里是创新互联建站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!