I am receiving two dates from a form, I am in the validation process on the server.
How do I validate the string if it is a valid date? I have now decomposed the date in an array $fecha_array = explode('-', $fecha);
and I have highlighted a count($fecha_array)
to verify that the array
has 3 data, and finally verify that it is a date valid with
checkdate($fecha_array[0], $fecha_array[1], $fecha_array[2])
the format used is mm-dd-yyyy
. Up there all the problem arises when I try with the following: 01-gg-2019
, I know that gg is not a day, but that's what validation is about. thanks for your help. the error that comes out is gg is not integer checkdate() expects parameter 1 to be integer, string given