php - How to find the time is fall between two times? -


i having 2 times in database.
starting time 07:00 ,
ending time 07:25 and
if chooses starting time application 07:10 , end time 07:35 need inform time not available booking.
how can check 07:10 , 07:35 fall between 07:00 , 07:25 using php?thanks in advance?

update:
may give 06:50 07:15.at time need find time falls between previous times?

you can convert times number of minutes since start of day make comparison easier.

07:00 = 07 * 60 + 00 = 420 call $start  

and

07:25 = 07 * 60 + 25 = 445 call $end 

similarly convert user input hh:mm min above , call them $userstart , $userend. need is:

if($userstart >= $start && $userend <= $end) {   // valid } 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -