更新时间:2023-01-30 10:54:15
这解决了您的问题:
This solves your problem:
$start = explode(':', $start_time);
$end = explode(':', $end_time);
$total_hours = $end[0] - $start[0] - ($end[1] < $start[1]);
请参阅此键盘作为证明。
此解决方案假定两个小时都是同一天。
This solution assumes both hours are from the same day.