I\'m obviously not using filter_var() correctly. I need to check that the user has entered a valid date, in the form \"dd/mm/yyyy\".
This simply returns whatever I p
You received a lot of answers that indicated the RegEx would allow for an answer of 99/99/9999. That can be solved by adding a little more to the RegEx. If you know you'll never have a date outside of the years 1900-2099... you can use a RegEx like this:
/^(0[1-9]|[12][0-9]|3[01])[/](0[1-9]|1[012])[/](19|20)\d\d$/
That will validate a date of this format: dd/mm/YYYY
Between: 01/01/1900 - 31/12/2099
If you need more years, just add them near the end. |21|22|23|24|25 (would extend it to the year 2599.)