无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
// 取得某月天数,可用于任意月份
function getDays($month, $year)
{
switch($month)
{
case 4:
case 6:
case 9:
case 11:
$days = 30;
break;
case 2:
if ($year%4==0)
{
if ($year 0==0)
{
$days = $year@0==0 ? 29 : 28;
}
else
{
$days =29;
}
}
else
{
$days = 28;
}
break;
default:
$days = 31;
break;
}
return $days;
}
**
* 根据时间戳取得对应的星期几
*
* @param int $time_stamp 时间戳
*/
function getWeek($time_stamp)
{
$week_num = date("w",$time_stamp);
switch($week_num)
{
case "0":
$week = "日";
break;
case '1':
$week = "一";
break;
case '2':
$week = "二";
break;
case '3':
$week = "三";
break;
case '4':
$week = "四";
break;
case '5':
$week = "五";
break;
case '6':
$week = "六";
break;
}
Return $week;
}

标签:
php,瑞年,平年,天数

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com