JAVA、PHP、前端、APP、网站开发 - 开发技术学习

文档标签: 日期

php根据日期判断星座.

php根据日期判断星座 <?php header('Content-type: text/html;charset=UTF-8'); function getConstellation($birthday, $format=null) { $pattern = '/^\d{4}-\d{1,2}-\d{1,2}$/'; if (!preg_match($pattern, $birthday, $matchs)) { return null; } $date = explode('-', $birthday); $year = $date[0]; $month = $date[1]; $day   = $date[2]; if ($month <1 || $month>12 || $day < 1 || $day >31) { return null; } //设定星座数组 $constellations = array( '摩羯座', '水瓶座', '双鱼座', '白羊座', '...
此文被围观3692次  分类: 编程开发 标签:  ····

站点声明:部分内容源自互联网,为传播信息之用,如有侵权,请联系我们删除。

© Copyright 2011-2024 www.kfju.com. All Rights Reserved.
超级字帖 版权所有。蜀ICP备12031064号