如何用date取得指定月份有多少天?

t - 指定月份的天数; 如: "28" 至 "31"

echo date('t');

这样就能得出本月有几天,可是我要指定一个月呢?

比如2010年2月呢?怎么搞?

$m=strtotime('2010-02');
echo   Date( 't ',$m);

这样不行,正确写法是怎样的?

<?php
echo cal_days_in_month(CAL_GREGORIAN,2,2010);//输入2010年2月份有多少天数
//基础要打牢.!!!
?>
原文地址:https://www.cnblogs.com/5ini99/p/3516929.html