I have an array with time values
print_r($timeVal);
output:
Array (
[2018-12-01] => 23:58:0
[2018-12-02] => 23:58:0
[2018-12-03] => 23:58:0
[2018-12-05] => 2:0:0
)
so i want to calculate all those and get total time: correct result should be
73:54 and not 3 days 1 hours 54 minutes 0 seconds
post is not duplicate coz i viewed other posts and they show Day hour minute not just hour min
example like this :
$sum = strtotime('00:00:00');
$sum2=0;
foreach ($TimeVal as $v){
$sum1=strtotime($v)-$sum;
$sum2 = $sum2+$sum1;
}
$sum3=$sum+$sum2;
date("H:i:s",$sum3) //this show 1:54:00