Check if m/d/Y formatted date is between two dates
08:17 12 Sep 2016

This is what you will be see in the UI,

Date Availing the Reservation: 9/12/2016(current date)
Date Needed: mm/dd/yyyy
Date of the Event: 9/26/2016(date 2 weeks from now)
Date Reservation will Expire: 9/15/2016

What I want is that when the Date Needed is less than the current date it will show date should not be from the past, and if Date Needed is equal to date now until the date of the event which is 26 I am only valid to avail at 27 how will I do that? I have this logic:

if ($date_needed < $date_reserved &&  $date_needed > $date_of_the_event) {
    echo "date must not be from the past and date of reservation must be 2 weeks from now";
} else {
    echo "success!";
}

This code didn't work well for me I mean, if I have this code, even thought I am putting the right code, it always comes up with error, I even else if this logic but it isn't working at all.

Also, I have this at my database: Date Reservation will Expire. I want if that day will come 9/15/2016. The row which has it, will automatically be deleted at the database or update it that is_active will be 0 how will I do that?

php date date-comparison