php事务
<?php set_time_limit(6); function sel($time,$number,$count){ if($count > 10){ sel($time,$number,$count); return ; }else{ if(time() > intval($time)){ $count++; @sel($time+$number,$number,$count); }else{ task(); $time = $time + $number * $count; $count++; sleep($number); @sel($time,$number,$count); } } } echo time(); sel(1473662611+8*3600,1,2); //echo '<br>'.time(); function task(){ echo '<br> This is task'.time().'<br>'; } ?>
sel(1473662611+8*3600,1,2); 中的1473662611 要是time() 转化出来,再填写上去,否则失效