I'm trying to write a script that will compare a child's birthdate to a cutoff date. If the child is born before the cutoff date the they are OK if they are born after the cutoff date then I want a message letting them know they they are not old enough. I think i'm in the ball park but it isn't working correctly.
$birthDate = "2009-09-03";// Child's Birthday
echo "Birth Date: $birthDate<br>";
$cutoffDate = "2010-09-03"; // Cut off date
echo "Cutoff Date: $cutoffDate<br>";
$lastDate = "2011-09-03"; //Last day accepting applications
echo "Last Date: $lastDate<br>";
if($birthdDate >= $cutoffDate){
echo "<br>You are eligible.";
}else{
echo "<br>You are not eligible, because your child must be 1 year old on or before $lastDate";
}