title: PHP checkdate variants
body: <p>I found a php function <a href="http://php.net/manual/en/function.checkdate.php" rel="nofollow">checkdate()</a> , but strangely enough it only seems to accept data in format of <code>int $month , int $day , int $year</code>. However I am passing the date as a string (example <code>"2012-06-13"</code>) so I came up with this workaround, because <strong>I would only allow date entered in such format</strong>. Unfortunately I am feeling this is both insecure and not a nice approach to the problem:</p>
  
  <pre><code>function CheckAdditional($value)
  {
      $data = explode("-", $value);
  
      return checkdate($data[1], $data[2], $data[0]);
  }
  </code></pre>
  
  <p>Question: is there a better way to check whether the date is valid?</p>