I am trying to check a date in a variable ($date_required_by) to see if it is a valid date or not. Any Ideas ?
I have tried this but it doesn't work...
$checkdate = date('d.m.y',$date_required_by);
$day = date('d',$checkdate);
echo ("Day is :". $day);
$month = date('m',$checkdate);
echo ("Month is:". $month);
$year = date('y',$checkdate);
echo ("Year is:" .$year);
echo ("Date Required by is:". $checkdate);
$val = checkdate($month, $day, $year);
if ($val)
{
echo "the date is true";
}
else
{
echo "the date is false";
}