- Joined
- Jul 30, 2002
- Location
- Midland, Ontario
Code:
<?
$work = date(w);
if ($work == 6){
echo "<h1>Sunday </h1>";
}elseif ($hwork == 0){
echo "<h1>Monday</h1> ";
}elseif ($work == 1){
echo "<h1>Tuesday</h1> ";
}elseif ($work == 2){
echo "<h1>Wednesday</h1>";
}elseif ($work == 3){
echo "<h1>thursday</h1>";
}elseif ($work == 4){
echo "<h1>Friday</h1>";
}else{
echo "<h1>Saturday</h1>";
}
?>
I made this little script,
its to display the next days work schedule /* I will be changing the days of the week to be variables but for testing they are just words */
When I use the funtion as is, the word Monday is displayed, when Friday should be, since it is thursday night.
if I replace the $work == 0 wirh $work == 5 Friday displays, I don't understand,
this shouldn't happen
anyone have any ideas?
didn't know were else to post this, normally I don't look for help, but this just baffles me and makes no sence.