How to determine the number of days in the month?

There are year and month, how to determine the number of days in this month?
To date php.net/manual/ru/function.date.php the variant described
t the Number of days in the given month 28 to 31


But this is to find out the number of days in the current month, for example
echo date("t");

And like him another year and month in input file?
June 14th 19 at 18:20
2 answers
June 14th 19 at 18:22
Solution
php.net: cal_days_in_month

<?php
$number = cal_days_in_month(CAL_GREGORIAN, 8, 2003); // 31
echo "Total {$number} days in August 2003";
?>
June 14th 19 at 18:24
Solution
The second parameter.

Example:
echo date('t', mktime(0, 0, 0, 6)); // the Number of days in June this year


date(), mktime()

Find more questions by tags PHP