Lea*_*ner 14
比较日期的最佳方式是使用时间戳:
$string = '11/05/2016';//string variable
$date = date('Y-m-d',time());//date variable
$time1 = strtotime($string);
$time2 = strtotime($date);
if($time1>$time2){
//do this
}
else{
//do this
}
Run Code Online (Sandbox Code Playgroud)
我希望它有所帮助