How do I add a time difference to an array with PHP?

priviet02

New Member
I have the following array structure in MySQL. There could be no items or many items; the example shows only three.\[code\]Array( [0] => Array ( [id] => 1 ... [start_time] => 09:00:00 [finish_time] => 10:20:00 ... ) [1] => Array ( [id] => 2 ... [start_time] => 13:00:00 [finish_time] => 14:20:00 ... ) [2] => Array ( [id] => 23 ... [start_time] => 18:05:00 [finish_time] => 19:35:00 ... ) etc etc)\[/code\]I want to add the time difference between start_time and finish_time and find out the total time with PHP. For example, the above should produce 250min or 4 hr 10min (80 min + 80min + 90min). How do I do this?
 
Back
Top