循环执行,将值转换为日期,然后将最新的值存储在var中。
$mostRecent= 0;foreach($dates as $date){ $curDate = strtotime($date); if ($curDate > $mostRecent) { $mostRecent = $curDate; }}
$mostRecent= 0;$now = time();foreach($dates as $date){ $curDate = strtotime($date); if ($curDate > $mostRecent && $curDate < $now) { $mostRecent = $curDate; }}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)