PHP – Do Until Certain Date

I'm not deep into PHP, so I wrote this 'hack' to allow HTML or whatever  until a certain date. The sample below will do whatever HTML is until  a certain date...

<?

// show this until Dec 31, 2009
$mymonth = date("m");
$myyear = date("Y");
$mycompare = $myyear . $mymonth;
// if its before Jan 2010, show NEW
if ($mycompare < 201001) {

?>

<p>Before 2010!</p>

<? } else { ?>

<p>Its 2010 or later!</p>

<? } ?>

Leave a comment

NOTE: Comments are moderated and will not appear immediately, if approved.

Your comment