Answer the question
In order to leave comments, you need to log in
Valid dates, is there a ready check?
We write the date 2009-06-04 in the MySQL field of the DATE type - everything is OK, we are trying to set the 13th month of 2009-13-04 - it is written 0000-00-00, which means you need to check the date for validity before entering it into the database.
Question: what?
There are ready-made high-quality ones, i.e. so that the validator knows in which specific years February 29 can be, for example, and the allowable number of days in each month.
I didn’t understand the checkdate () chips manually: var_dump(checkdate(12,20,2009)); //true
I accept from the form
echo $_POST['date'];
var_dump(checkdate($_POST['date']));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question