Reputation: 13
I am trying to show a text in a page only on Thursday between 9pm to 10pm.
At the moment I wrote this code:
if((date('N') == 4 && date('G') >= 21) || (date('N') == 4 && date('G') < 22)) {
echo "Text";
}
but not work.
Upvotes: 0
Views: 22
Reputation: 1381
The or was causing the problem. So it always echo out.
if(date('N') == 4 and ( date('G') >= 21 and date('G') < 22)) {
echo "Text";
}
Upvotes: 2