php獲取指定月的 起止時間戳
- $Y = 2016;//獲取年,示例,真實環境從前端獲取資料
- $m = 8;//獲取月,示例,真實環境從前端獲取資料
- $month = $Y."-".$m;//當前年月
- $month_start = strtotime($month);//指定月份月初時間戳
- $month_end = mktime(23, 59, 59, date('m', strtotime($month))+1, 00);//指定月份月末時間戳
- //dump(array("month"=>$month,"month_start"=>$month_start,"month_end"=>$month_end));//輸出