日期:2014-05-16 浏览次数:20545 次
<?php
date_default_timezone_set('PRC');
$c1=0;
$c2=0;
$c3=0;
$c4=0;
$c5=0;
$c6=0;
$c7=0;
$w = date("w",time());
switch($w){
case 1:
break;
case 2:
$t1=strtotime(date("Y-m-d")." 23:59:59");//周二
$t2=strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");//周一
if($t2<1387420136&&1387420136<=$t1){
$c1 += 1;
}elseif(1387420136<=$t2){
$c2 += 1;
}
echo $c1;
break;
case 3:
$t1=strtotime(date("Y-m-d")." 23:59:59");//周三
$t2=strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");//周二
$t3=strtotime(date("Y-m-d",strtotime("-2 day"))." 23:59:59");//周一
if($t2<1387420136&&1387420136<=$t1){
$c1 += 1;
}elseif($t3<1387420136&&1387420136<=$t2){
$c2 += 1;
}elseif(1387420136<=$t3){
$c3 += 1;
}
echo $c1;
break;
case 4:
$t1=strtotime(date("Y-m-d")." 23:59:59");//周四
$t2=strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");//周三
$t3=strtotime(date("Y-m-d",strtotime("-2 day"))." 23:59:59");//周二
$t4=strtotime(date("Y-m-d",strtotime("-3 day"))." 23:59:59");//周一
if($t2<1387420136&&1387420136<=$t1){
$c1 += 1;
}elseif($t3<1387420136&&1387420136<=$t2){
$c2 += 1;
}elseif($t4<1387420136&&1387420136<=$t3){
$c3 += 1;
}elseif(1387420136<=$t4){
$c4 += 1;
}
echo $c1;
break;
case 5:
$t1=strtotime(date("Y-m-d")." 23:59:59");//周五
$t2=strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");//周四
$t3=strtotime(date("Y-m-d",strtotime("-2 day"))." 23:59:59");//周三
$t4=strtotime(date("Y-m-d",strtotime("-3 day"))." 23:59:59");//周二
$t5=strtotime(date("Y-m-d",strtotime("-4 day"))." 23:59:59");//周一
if($t2<1387420136&&1387420136<=$t1){
$c1 += 1;
}elseif($t3<1387420136&&1387420136<=$t2){
$c2 += 1;
}elseif($t4<1387420136&&1387420136<=$t3){
$c3 += 1;
}elseif($t5<1387420136&&1387420136<=$t4){
$c4 += 1;
}elseif(1387420136<=$t5){
$c5 += 1;
}
echo $c1;
break;
case 6:
$t1=strtotime(date("Y-m-d")." 23:59:59");//周六
$t2=strtotime(date("Y-m-d",strtotime("-1 day"))." 23:59:59");//周五
$t3=strtotime(date("Y-m-d",strtotime("-2 day"))." 23:59:59");//周四
$t4=strtotime(date("Y-m-d",strtotime("-3 day"))." 23:59:59");//周三
$t5=strtotime(date("Y-m-d",strtotime("-4 day"))." 23:59:59");//周二
$t6=strtotime(date("Y-m-d",strtotime("-5 day"))." 23:59:59");//周一
if($t2<1387420136&&1387420136<=$t1){
$c1 += 1;
}elseif($t3<1387420136&&1387420136<=$t2){
$c2 += 1;
}elseif($t4<1387420136&&1387420136<=$t3){
$c3 += 1;
}elseif($t5<1387420136&&1387420136<=$t4){
$c4 += 1;
}elseif($t6<1387420136&&1387420136<=$t5){
$c5 += 1;
}elseif(1387420136<=$t6){
$c6