Skip to content

Instantly share code, notes, and snippets.

@ManojKiranA
Forked from linkimfly/phpresult.txt
Created June 1, 2019 13:02
Show Gist options
  • Save ManojKiranA/996e85d2db0317c24f89e06f0d4df32c to your computer and use it in GitHub Desktop.
Save ManojKiranA/996e85d2db0317c24f89e06f0d4df32c to your computer and use it in GitHub Desktop.
The effect you want
desc:
In addition, if the current time is less than 30 minutes from endhour, expired is also counted as expired.
Array
(
[0] => Array
(
[date] => 2019-06-01
[week] => Saturday
[subdate] => 06-01
[timelist] => Array
(
[0] => Array
(
[period] => 08 ~ 10
[starthour] => 08
[endhour] => 10
[expired] => true //My current time is 20:07, so the output true means it has expired.
)
[1] => Array
(
[period] => 10 ~ 12
[starthour] => 10
[endhour] => 12
[expired] => true //My current time is 20:07, so the output true means it has expired.
)
[2] => Array
(
[period] => 12 ~ 14
[starthour] => 12
[endhour] => 14
[expired] => true //My current time is 20:07, so the output true means it has expired.
)
[3] => Array
(
[period] => 14 ~ 16
[starthour] => 14
[endhour] => 16
[expired] => true //My current time is 20:07, so the output true means it has expired.
)
[4] => Array
(
[period] => 16 ~ 18
[starthour] => 16
[endhour] => 18
[expired] => true ////My current time is 20:07, so the output true means it has expired.
)
[5] => Array
(
[period] => 18 ~ 20
[starthour] => 18
[endhour] => 20
[expired] => true //My current time is 20:07, so the output true means it has expired.
)
[6] => Array
(
[period] => 20 ~ 22
[starthour] => 20
[endhour] => 22
[expired] => false //Here is false because my current time has not expired, my current time is 20:07 at night.
)
)
)
[1] => Array
(
[date] => 2019-06-02
[week] => Sunday
[subdate] => 06-02
[timelist] => Array
(
[0] => Array
(
[period] => 08 ~ 10
[starthour] => 08
[endhour] => 10
[expired] => false //Because it is June 2, so compared with the current time has not passed.
)
[1] => Array
(
[period] => 10 ~ 12
[starthour] => 10
[endhour] => 12
[expired] => false //Because it is June 2, so compared with the current time has not passed.
)
[2] => Array
(
[period] => 12 ~ 14
[starthour] => 12
[endhour] => 14
[expired] => false //Because it is June 2, so compared with the current time has not passed.
)
[3] => Array
(
[period] => 14 ~ 16
[starthour] => 14
[endhour] => 16
[expired] => false //Because it is June 2, so compared with the current time has not passed.
)
[4] => Array
(
[period] => 16 ~ 18
[starthour] => 16
[endhour] => 18
[expired] => false //Because it is June 2, so compared with the current time has not passed.
)
[5] => Array
(
[period] => 18 ~ 20
[starthour] => 18
[endhour] => 20
[expired] => false //Because it is June 2, so compared with the current time has not passed.
)
[6] => Array
(
[period] => 20 ~ 22
[starthour] => 20
[endhour] => 22
[expired] => false //Because it is June 2, so compared with the current time has not passed.
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment