ex:
<?php
$tid1 = '12:13:11';
$tid2 = '03:33:21';
list($h, $m, $s) = explode(':', $tid2);
echo date("H:i:s", strtotime("$tid1 +$h hour +$m minute +$s second"));
?>
1 svar · 347 visningar · startad av Davida
Om jag har två variabler som innehåller tids-information, ex "12:13:11" och "03:33:21" hur gör jag då för att summera dessa?
ex:
<?php
$tid1 = '12:13:11';
$tid2 = '03:33:21';
list($h, $m, $s) = explode(':', $tid2);
echo date("H:i:s", strtotime("$tid1 +$h hour +$m minute +$s second"));
?>