I get dates from a text area in the dd-mm-yyyy or dd/mm/yyyy format (the user is allowed to use – or /) How do I check (using a regex or php) if the date is valid? Is there a regex or php method done this far to validate dates in this format? I tried searching here but could not find anything.
Share
I came up with this little function, it checks you use the format
DD(separator)MM(sameseparator)YYYYWith DD, MM and YYYY as integers.
(Edited as sugested below)