public static function get_number_of_day($month, $year) { $end_day = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $day = $end_day[$month - 1]; //index array dari 0 jd hrs -1 if ($month == 2) { if (MyDate::is_leap_year($year)) { //cek taun kabisat $day = 29; } } return $day; }