Validate date in DD-MM-YYYY” Format in php
<p>Can this format  <code>10-7-2010</code> validated with php?
With this script:</p>

<pre><code>$array = explode('-', $str);
$day = $array[0];
$month = $array[1];
$year = $array[2];
$Valid = checkdate($month, $day, $year);
</code></pre>

<p>I have this error:</p>

<pre><code>checkdate() expects parameter 2 to be long
</code></pre>

<p>How can I validate such format?
Thanks in advance</p>
