title: Using filter_var() to verify date?
body: <p>I'm obviously not using <a href="http://php.net/manual/en/function.filter-var.php">filter_var()</a> correctly. I need to check that the user has entered a valid date, in the form "dd/mm/yyyy".</p>
  
  <p>This simply returns whatever I passed as a date, while I expected it to return either the date or 0/null/FALSE in case the input string doesn't look like a date:</p>
  
  <pre><code>$myregex = "/\d{2}\/\d{2}\/\d{4}/";
  print filter_var("bad 01/02/2012 bad",FILTER_VALIDATE_REGEXP,array("options"=&gt;array("regexp"=&gt; $myregex)));
  </code></pre>
  
  <p>If someone else uses this function to check dates, what am I doing wrong? Should I use another function to validate form fields?</p>
  
  <p>Thank you.</p>