I want sum of 3 different times.
Ex:
h1 = "04:23";
h2 = "04:16";
h3 = "00:00";
So answer should be $hours = "08:39"
I have searched for that and got many solution but not getting right answer.
Here is my code:
$hours = strtotime($h1) + strtotime($h2) + strtotime($h3);
$total_hours = date("H:i", intval($hours));
echo $total_hours;
"00:00" is the answer which am getting for above code. I don't want to use any user define function which can add times. Can anyone please help me?