public static function getWeekNum($date) { $tahun = date("Y", strtotime($date)); $bulan = date("m", strtotime($date)); $arrOfWeek = Tanggal::weekOfMonth($tahun, $bulan); //return "JML".count($arrOfWeek); $num = 0; foreach ($arrOfWeek as $week) { //echo $week[0]." ++ ".$date." ++ ".$week[1]."<br>"; if (strtotime($week[0]) <= strtotime($date) && strtotime($date) <= strtotime($week[1])) { return $num; } $num++; } return -1; }