function get_ctime($month){
? ? ? ? $month_start =strtotime($month) ;//指定年月份月初時間戳
? ? ? ? $BeginDate=date('Y-m-01', strtotime($month));
? ? ? ? $EndDate = date('Y-m-d', strtotime("$BeginDate +1 month -1 day"));
? ? ? ? $month_end= strtotime("next day", strtotime($EndDate)) - 1;//指定年月份月末時間戳
? ? ? ? $months=$month_start .' and '.$month_end;
? ? ? ? return $months;
}
$month = "2018-12";
echo get_ctime($month); // 輸出