PHP Check if time is between two times regardless of date

前端 未结 5 1128
挽巷
挽巷 2020-12-03 06:26

I\'m writing a script were I have to check if a time range is between two times, regardless of the date.

For example, I have this two dates:

$from          


        
5条回答
  •  心在旅途
    2020-12-03 06:53

    This code works for me

    if($start_time<=date("H:i") && $end_time>=date("H:i")) {

    }

提交回复
热议问题