我想比較兩次。 但是,首先我想數一次110分鐘。 我做錯了什麼?如何使用php添加和比較兩次
代碼:
$current_time = date("H:i");
$match_start = strtotime("H:i", "19:30"); // <- Value from database
$match_end = strtotime("+110 minutes", $match_start)
if($current_time > $match_start && $current_time < $match_end) {
//Match has started
}
有你甚至閱讀[文檔的strtotime(http://php.net/manual/en/function.strtotime.php)?第二個參數應該是時間戳,而不是字符串... – Kleskowy 2014-09-02 13:59:25