我正在尝试使PHP脚本来查找下一个日期的发生(比如5-1)。但是,如果我把它放在strtotime()
在5-2它从今年的日期。我只是想让它始终返回下一个可能的日子。我该如何做这项工作?如果有帮助,我使用codeigniter。使strtotime()仅在未来生成时间
编辑:下面是一些代码,我想出了,如果有些卑微的灵魂在同样的问题上运行:
if (strtotime($date) < strtotime("now")) {
$realseconds = strtotime($date) + 31556926; //add one year in seconds
} else {
$realseconds = strtotime($date);
}
你会认为这会起作用,但不幸的是它没有。 strtotime返回false。 – 2009-12-26 16:24:33