渣技术勿喷
-
$friday = strtotime("next Friday 18:00:00");
- $time = time();
- $s = $friday-$time;
- $days = floor($s/24/60/60); //剩余天数
- $hour = floor( ($s-$days*24*60*60)/60/60 ); //剩余小时
- $minute = floor( ($s-$days*24*60*60-$hour*60*60)/60 ); //剩余分钟
- $second = floor($s-$days*24*60*60-$hour*60*60-$minute*60); //剩余秒数
- echo json_encode(array('days'=>$days , 'hour'=>$hour , 'minute'=>$minute , 'second'=>$second ));
- ?>
复制代码
|