I need to calculate the minutes in any month for any year. For example, I want to show for 2013, 2014, and 2015 (and any other year) that January has 4460 minutes, September has 43200 minutes, etc. I could probably hard-code that, but the issue is obviously February. If it is a leap year, it has 41760 minutes, if it isn't it has 40320 minutes. I guess I'm not even sure what the best way to approach this is. Maybe something with date("t") and mktime? Write something that only changes Feb. if it is a leap year? Any guidance is appreciated.
Edit: as requested, what I have tried (and failed with)...
$totaldays = date("t", mktime($month));
if $totaldays=31
$totmin=44640
elseif $totaldays=30
$totmin=43200
elseif $totaldays=29
$totmin=41760
else $totaldays=28
$totmin=40320