如果您由于某种原因不需要专门存储它,则无需运行cron等。然后计算分钟数并将其添加到您的起始号码(1500)
//Start Number$n = 1500;$cur_time = time();$orig_time = strtotime("2013-10-21 10:00:00");//New Number + difference in minutes (120 seconds for 2 mins) since start time$newn = $n + round(abs($cur_time - $orig_time) / 120,0);// Output New Numberecho $newn;
如果您希望在一行中进行复制/粘贴
echo 1500 + round(abs(time() - strtotime("2013-10-21 10:00:00")) / 120,0);
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)