Hi,
I’m trying to put together a script that would basically display a message between 8-10pm and otherwise display nothing else. This logic below seems to make sense to me but it doesn’t appear to be working - I’m new to PHP and I’m sure anybody else can see the obvious mistakes, so please point them out to me!
Thank you!
[php] <?php
$b = time();
$hour = date(“g”,$b);
$m = date (“A”, $b);
if ($m == “PM”)
{
if ($hour == 12)
{
echo “”;
}
elseif ($hour == 8)
{
echo “
}
elseif ($hour < 10)
{
echo “
}
elseif ($hour > 9)
{
echo “”;
}
elseif ($m == “AM”)
{
echo “”;
}
}
?>[/php]