Subtract time in PHP
If you get valid date strings, you can use this:
$workingHours = (strtotime($end) - strtotime($start)) / 3600;
This will give you the hours a person has been working.
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.