I have tried for hours to figure this out and it's beaten me. Why does $currentDay return a number representing the day of the week? Can I not assign a variable to the date?
<?php
date_default_timezone_set("America/New_York");
$currentDay = date('l'); // dayname
$currentTime = date("H");
$preOpen = "We're Open";
$preClosed = "We're Closed";
if ($currentDay = "Thursday" && $currentTime >= "22") {
echo $preClosed."<br>";
} elseif ($currentDay = "Friday") {
echo $preClosed."<br>";
} elseif ($currentDay = "Saturday" && $currentTime >= "22") {
echo $preClosed."<br>";
} else {echo $preOpen."<br>";
}
echo date('l')."<br>";
echo $currentDay
?>