Simple Day / Date PHP not working? -


i'm using following show div on day , @ time , it's not working properly. seems recognising time (and displays correctly when should) ignoring 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 strip out time reference altogether still doesn't work. shows div regardless of day is.

<?php $current_day = date(l); if ($current_day = "thursday") { ?> <div id="content">content here</div>  <?php } ?> 

i'm sure super simple can't see it.

any ideas?

you're using = instead of == in if statement.

it assign, true, except if assign false,0, null or empty string.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -