NYCPHP Meetup

NYPHP.org

[nycphp-talk] Date Check

crisscott at netzero.com crisscott at netzero.com
Wed Jul 16 15:08:25 EDT 2003


I assume you are trying to check the number of days in the month so you don't end up with 2-31-2003.  It depends on how you are collecting the information.  If you are having them fill in three different fields you could try something like this...

if($_POST['day'] > date('t', mktime(0,0,0,$_POST['month'],1,$_POST['year'])) {
   // Too many days
}

Scott



More information about the talk mailing list