我有下面的代碼,我想比較兩個得到爲了進入if語句,但我錯了代碼。php - 比較兩個日期
如果時間超過23:29和小於08:10下面的代碼應該運行...
$gettime="04:39"; // getting this from database
$startdate = strtotime("23:29");
$startdate1 = date("H:i", $startdate);
$enddate = strtotime("08:10");
$enddate1 = date("H:i", $enddate);
//this condition i need to run
if($gettime >= strtotime($startdate1) && $gettime <= strtotime($enddate1))
{
echo"ok working";
}
請幫我在DIS方面
感謝