title: Validate if age is over 18 years old
body: <p>Just wondering, can I do this to validate that a user has entered a date over 18?</p>
  
  <pre><code>//Validate for users over 18 only
  function time($then, $min)
  {
      $then = strtotime('March 23, 1988');
      //The age to be over, over +18
      $min = strtotime('+18 years', $then);
      echo $min;
      if (time() &lt; $min) {
          die('Not 18');
      }
  }
  </code></pre>
  
  <p>Just stumbled across this function date_diff:
  <a href="http://www.php.net/manual/en/function.date-diff.php" rel="nofollow noreferrer">http://www.php.net/manual/en/function.date-diff.php</a>
  Looks, even more promising.</p>