function isValidDate($date)
{
list($year, $month, $day) = explode('-', $date);
if (!is_numeric($year) || !is_numeric($month) || !is_numeric($day))
{
return false;
}
return checkdate($month, $day, $year);
}
{
list($year, $month, $day) = explode('-', $date);
if (!is_numeric($year) || !is_numeric($month) || !is_numeric($day))
{
return false;
}
return checkdate($month, $day, $year);
}
$date = explode("-", $date);
echo checkdate($date[1], $date[2], $date[0]);