I have a date format of DD/MM/YYYY and I want to check in a form submission whether the submitted date is present in the calendar or not.
Code:
$last_date = $_POST['last_date'];
$date = str_replace("/", "-", $last_date);
$d = explode("-" , $date);
if( !checkdate($d[1], $d[0], $d[2]) )
error[] = 'Warning! This date does not have any existence.';