I created a script that needs to get the number of days for the given month.
Problem is that when I ask it for the number of days in February it returns 31, and when I ask for March it returns 28.
Am I doing something wrong?
CODE:
<?php
$daysJan = date("t", mktime(0,0,0,1,0,2002));
$daysFeb = date("t", mktime(0,0,0,2,0,2002));
$daysMar = date("t", mktime(0,0,0,3,0,2002));
print("January: $daysJan days<br />February: $daysFeb days<br />March: $daysMar days<br />");
?>
RESULT:
January: 31 days
February: 31 days
March: 28 days