Php
Second task: Consider following timings of a salon: $open_datetime = "17-03-2019 09:30AM"; $close_datetime = "18-03-2019 02:00PM"; $off_times = array( 0=> array( "from"=>"17-03-2019 02:00PM", "to"=>"17-03-2019 03:00PM" ), 1=> array( "from"=>"17-03-2019 07:30PM", "to"=>"18-03-2019 9:30AM" ) ); $already_booked_slots = array( 0=> array( "from"=>"17-03-2019 10:00AM", "to"=>"17-03-2019 11:00AM" ), 1=> array( "from"=>"18-03-2019 11:30AM", "to"=>"18-03-2019 12:30PM" ) ); Following is the datetime when some user want to do a booking(you can enter any other datetime in below) $user_start_datetime = "17-03-2019 11:30AM"; $user_end_datetime = "17-03-2019 12:30PM"; You need to check if booking can be done in requested start and end datetime or not?