+
+ return $days_in_month[$month - 1];
+}
+
+function end_month($date)
+{
+ global $date_system;
+
+ list($day, $month, $year) = explode_date_to_dmy($date);
+ if ($date_system == 1)
+ {
+ list($year, $month, $day) = gregorian_to_jalali($year, $month, $day);
+ }
+ elseif ($date_system == 2)
+ {
+ list($year, $month, $day) = gregorian_to_islamic($year, $month, $day);
+ }
+
+ return __date($year, $month, days_in_month($month, $year));