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
A simple and convenient way to verify the date in PHP is a strtotime function. You can validate the date with only one line:
strtotime("bad 01/02/2012 bad"); //false
strtotime("01/02/2012"); //1325455200 unix timestamp
Try setting the start and end for your regex like this:
$myregex = "/^\d{2}\/\d{2}\/\d{4}$/";