public static function getDaysInMonth($month, $year)
    {
        if ($year == 1582 && $month == 10) {
            return 21;  // October 1582 only had 1st-4th and 15th-31st
        }

        if ($month == 2) {
            if (self::isLeapYear($year)) {
                return 29;
            } else {
                return 28;
            }
        } elseif ($month == 4 or $month == 6 or $month == 9 or $month == 11) {
            return 30;
        } else {
            return 31;
        }
    }
public static function getDaysInMonth($month, $year)
    {
        if ($year == 1582 && $month == 10) {
            return 21;  // October 1582 only had 1st-4th and 15th-31st
        }

        if ($month == 2) {
            if (self::isLeapYear($year)) {
                return 29;
            } else {
                return 28;
            }
        } elseif ($month == 4 or $month == 6 or $month == 9 or $month == 11) {
            return 30;
        } else {
            return 31;
        }
    }
public static function getDaysInMonth ( $ month , $ year ) { if ( $ year == 1582 && $ month == 10 ) { return 21 ; // October 1582 only had 1st-4th and 15th-31st } if ( $ month == 2 ) { if ( self :: isLeapYear ( $ year ) ) { return 29 ; } else { return 28 ; } } elseif ( $ month == 4 or $ month == 6 or $ month == 9 or $ month == 11 ) { return 30 ; } else { return 31 ; } }
Find the number of days in the given month

@param   int     $month  the month
@param   int     $year   the year in four digit format
@return  int     the number of days the month has
Find the number of days in the given month