I have been looking for an answer for a few hours now, but I can\'t find one.
I\'m writing a simple script. The user sets their work start and end time.
script
A bit nicer is the following:
$a = new DateTime('08:00'); $b = new DateTime('16:00'); $interval = $a->diff($b); echo $interval->format("%H");
That will give you the difference in hours.