I know I can get the number of days in the current month with 
date("t"), but how would I go about getting the number of days in a 
different month?

I have a form that allows users to insert a date.  If the value they 
put in doesn't exist (February 31, 2001, for example), I want to 
override it.  I'm already using checkdate to determine if a date is 
bad, but I'm a bit stumped on using date("t") to set a valid maximum 
for the month the user submits.  (I've set up the form so that users 
will always submit a valid month, but the day is my one loose end.)

Here's my code, if you'd like to make suggestions:

$ver_date = checkdate($date_month, $date_day, $date_year);

if ($ver_date) {

        $safedate = $date_year."-".$date_month."-".$date_day;

} else {

        //reset their date_day somehow

}


Thanks for any suggestions,
Maurice

-- 
Maurice Rickard
http://mauricerickard.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to