title: Check if date is in 'Y-m-d' format and is not in future date?
body: <p>I have a form to catch a post input field which will be in date format, i need to check if this post field is in <code>Y-m-d</code> format and the date is not in any future date.</p>
  
  <pre><code>$dob = $_POST['dob']; 
  // 1995-11-03 =&gt; Correct format
  // 1995-30-12 =&gt; Incorrect format
  // 2018-09-23 =&gt; Incorrect future date
  </code></pre>