function checktime($time){ $ystd = strtotime(date("Y-m-d")); $ystd = date("Y-m-d",$ystd); $ystd = strtotime($ystd."00:00:00"); $today = strtotime('+1 day'); $today = date("Y-m-d",$today); $today = strtotime($today."00:00:00"); if($ystd < $time and $time < $today){ return true; }else{ return false; } } 该方法适合用在一些 签到的程序 ,根据取出的时间戳 判断是否在当天 ,返回布尔类型