Page 1 of 1

day check for if statement

Posted: Mon Nov 08, 2010 12:03 pm
by Obadiah
say I wanted to not allow any records to be entered after the 20th of each month and check for it in my if statement how would I go about doing that?
I know how to declare the time

Code: Select all

$time=time();
$realdate = date("m/d/y",$time);
how would I go about forming my if?

Re: day check for if statement

Posted: Mon Nov 08, 2010 12:12 pm
by Jonah Bron

Code: Select all

if (intval(date('d', $time)) >= 20) {
    // do something
} else {
    // reject
}