判断时间戳所对应的月份有几天。
//默认为当前时间戳。
date('t');
//判断具体某个月。
date('t',strtotime('2018-11-1'));
问题:写出一个函数,参数为年份和月份,输出结果为指定月的天数
function day_count($year,$month){
echo date('t',strtotime($year.'-'.$month.'-1'));
}
判断时间戳所对应的月份有几天。
//默认为当前时间戳。
date('t');
//判断具体某个月。
date('t',strtotime('2018-11-1'));
问题:写出一个函数,参数为年份和月份,输出结果为指定月的天数
function day_count($year,$month){
echo date('t',strtotime($year.'-'.$month.'-1'));
}
本文标题:date('t')是什么?
本文链接:https://www.haomeiwen.com/subject/kmwecqtx.html
网友评论