您如何看待该解决方案。
例如:
$firstHour = '08:30';
$secondHour = '12:30';
$test = $firstHour >= $secondHour; // will be false
$test2 = $secondHour >= $firstHour; //will be true
该解决方案有什么弱点吗?
答案 0 :(得分:0)
您可以尝试将转换时间转换为strtotime()
$firstHour = strtotime('08:30');
$secondHour = strtotime('12:30');
$test = $firstHour >= $secondHour;
$test2 = $secondHour >= $firstHour;