I need code that will print different PHP statements depending on the time and day of...

jsssika

New member
...week? Can someone help me write code that will display different text for a help desk depending on if it's Monday thru friday and between 9-5? I have the following code and can't figure out what I'm doing wrong. The time variables work if I do them by themselves but I can't figure out how to do this with the day too.

Thanks!
<?php
$today = date('F d, Y');
$time = date ('H:i');
$day = date("I");
$current_time = date("G");

if ($current_time < "17" && $current_time > "9" && $day == "Friday")

{print "The help desk is open and available for techinal support!<br /><br />";

}else
{print "We're sorry, the help desk is not open at this time, please try again on Monday thru Friday.<br />";

}
?>
 
Back
Top