How to convert hh:mm:ss to minutes
php
Solution
Try sometthin like this :
function minutes($time){
$time = explode(':', $time);
return ($time[0]*60) + ($time[1]) + ($time[2]/60);
}
LIVE DEMO
Problem
I have a time column `$data['Time'] (hh:mm:ss)` and I need to convert it to minutes. How can I do this? When I am writing like this: ``` $avg = ($data['Kilometers'] / $data['Time']) * 60; ``` I have this error ``` Warning: Division by zero in ... on line .. ```