Hi,
I thought this was going to be easy but I just can't get it to work. I want to display some text between 8am - 5pm weekdays and Saturdays and alternate text between 5pm - 8am weekdays and Sundays. Here is what I've tried:
<?php
$number1 = '1';
$number2 = '2';
$curtime = localtime(time(),true);
if ($curtime['tm_hour']<=17 and $curtime['tm_hour']>=8 and $curtime['tm_wday']!=0) {
$text = $number1;
} else {
$text = $number2;
}
?>
<html>
<head>
</head>
<body>
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<font face="arial" size="4"><?php echo $text ?></font>
</td>
</tr>
</table>
</center>
</body>
</html>
But I only ever see '1' when I try. The system time is set correctly and no PHP warnings are being given.