Simple Day / Date PHP not working?
I'm using the following to only show a div on a certain day and at a
certain time and it's not working properly. It only seems to be
recognising the time (and displays correctly when it should) but is
ignoring the day altogether.
<?php
$current_time = date(G);
$current_day = date(l);
if ($current_day = "Thursday" && $current_time >= 19 && $current_time <=
21) { ?>
<div id="content">content here</div>
<?php } ?>
If I strip out the time reference altogether it still doesn't work. It
just shows the div regardless of what day it is.
<?php
$current_day = date(l);
if ($current_day = "Thursday") { ?>
<div id="content">content here</div>
<?php } ?>
I'm sure this is something super simple but I just can't see it.
Any ideas?
No comments:
Post a Comment