编程爱好者之家
public function GetWeek($strDate = ''){ $tim = time(); if(!empty($strDate) && isset($strDate)){ $tim = strtotime($strDate); } /* 0:周末 1-6:周一 至 周六 */ $weekIndex = (int)date('w',$tim); switch($weekIndex){ case 0: return "星期天"; case 1: return "星期一"; case 2: return "星期二"; case 3: return "星期三"; case 4: return "星期四"; case 5: return "星期五"; case 6: return "星期六"; default: return ""; } }