Hi, I need some help maybe somebody can help me. I have two functions and I need to show different function on the certain time and day.
For example:
if(($day=='Monday till Friday') && ($time == '06:00 till 18:00')) print function1(); else print function2();
Thanks in advance.
One way:
<?php date_default_timezone_set('America/New_York'); list($day, $hour) = explode(',', date('N,G')); if($day >= 1 && $day <= 5 && $hour >= 6 && $hour < 18) { echo "yes ($day - $hour)"; } else { echo "no ($day - $hour)"; }