I have a php code as shown below in which I want to display anything in between two calendar days of the week. 

The values coming inside `$data->{"select_start_day"};` `$data->{"start_time"};` `$data->{"select_end_day"};` and `$data->{"end_time"};` is controlled by the user. 

**PHP Code:**

```
    if (file_exists('feeds/ptp-ess_landing.json')) {
    $data = json_decode(file_get_contents('feeds/ptp-ess_landing.json'));
    }

    date_default_timezone_set('America/Toronto');
    $arradate = strtolower(date('D'));
    $nowtime = (int)date('His');

    $start_day=$data->{"select_start_day"};
    $start_time=$data->{"start_time"};

    $end_day=$data->{"select_end_day"};
    $end_time=$data->{"end_time"};

```

**For example**, let us suppose the user enter `$start_day` as `sun`
`$start_time` as `143400` `$end_day` as `wed` `$end_time` as `140000`

The above time duration means we are in range and it should display anything we want to display until tomorrow 2pm as tomorrow is wednesday. I am in EST. 

I am using the following code in order to **pull the current day of the week and time**:

```
date_default_timezone_set('America/Toronto');
$arradate = strtolower(date('D'));
$nowtime = (int)date('His');

```

**Problem Statement:** 

I am wondering what if logic I need to use so that its print anything `Sunday` `143400` and `Wednesday` `140000`.

```
if()    {
    echo "Its in range";
}

```

**Cases:**

1. If the override is supposed to apply from *Monday at 8am* to *Monday at 6pm* **and today is Wednesday** then the override doesn't apply.
2. If its *Monday 6 pm* and *Friday 6 pm* then the override will work for **6 hours on Monday**, **Tuesday whole day**, **Wednesday whole day**, **Thursday whole day**, **Friday upto 6pm**
3. If it *Sunday 6pm* and *Monday 6pm* then the override will work for **6 hours on Monday** and **18 hours on Monday**.
4. If its *Tuesday 6pm* and *Friday 6pm* and **today is Tuesday 9pm** then the override will apply.
5. if its *Thursday 6pm* and *Wednesday 6pm* then the override will work for **6 hours on thursday**, **24 hours on Friday**, **24 hours on Saturday**, **24 hours on Sunday**, **24 hours on Monday**, **24 hours on Tuesday**, **24 hours on Wednesday** and **18 hours on Thursday**.