$MyArr = array(
array('1', 'Morning', '09:00:00','10:30:00'),
array('2', 'Late Morning', '10:31:00','12:00:00'),
array('3', 'Lunch', '12:01:00','14:00:00'),
array('4', 'Afternoon', '14:01:00','16:00:00'),
array('5', 'Evening', '16:01:00','19:00:00'),
);
I would like to create a function to check something like this
if '14:00:00', '16:00:00' is passed and can be found in that array it should return the first 2 values i.e. 4 and Afternoon
Here's the Test scenario:
'09:10:00','10:30:00' -> pass (return '1', 'Morning' )
'12:00:00','14:30:00' -> Fail
'10:30:00','12:00:00' -> should also pass (yeah, i need to add 1 minute to start time if it doesnt fit) (return '2', ' Late Morning' )
'09:00:00','16:00:00' -> Fail
How can i write code for this?