Need help to calculate $work_in_daytime
and $work_in_nighttime
.
$nightStart = '22:00';
$nightEnd = '07:00';
$workers = array(
'0' => array(
'name' => 'Lyons',
'start' => '15:15',
'end' => '23:45'
),
'1' => array(
'name' => 'Santos',
'start' => '10:00',
'end' => '22:00'
),
'2' => array(
'name' => 'Montgomery',
'start' => '22:30',
'end' => '08:00'
)
);
foreach ($workers as $worker) {
$length_of_work = abs(strtotime($worker['start']) - strtotime($worker['end'])) / 3600;
$work_in_daytime = '';
$work_in_nighttime = '';
}
Thanks for your help.