0
我想使時間計數器它工作正常,但它不會停止在00:00:00並返回到24:00:00。 這是我的代碼。如何停止時間計數器在00在PHP和javascript
<?php
session_start();
$from_time1 = date('Y-m-d H:i:s');
$to_time1 = $_SESSION['end_time'];
$timefirst = strtotime($from_time1);
$timesecond = strtotime($to_time1);
$difference = $timesecond-$timefirst;
echo gmdate("H:i:s",$difference);
?>
嘗試使用if? – r1verside