wordpress - PHP Include based on date -
trying change includes based on specific date. work:
if (date('m/d/y') < date('m/d/y', strtotime("01/10/2011"))) { //display } else if (date ('m/d/y') >= date('m/d/y', strtotime("01/10/2011")) && date ('m/d/y') <= date("m/d/y', strtotime("05/10/2011")) // display else else { //display different }
if understanding strtotime function correctly, figure work. not sure understanding correctly. let me know!
date
returns string 2011-01-26
, can't compare string 2011-02-23
useful result. need compare timestamps produced strtotime
or time
:
if (time() /* (now) */ < strtotime('2011-01-26')) ...
Comments
Post a Comment