Just wondering, can I do this to validate that a user has entered a date over 18?
//Validate for users over 18 only
function time($then, $min)
{
$then = strtotime('March 23, 1988');
//The age to be over, over +18
$min = strtotime('+18 years', $then);
echo $min;
if (time() < $min) {
die('Not 18');
}
}
Just stumbled across this function date_diff: http://www.php.net/manual/en/function.date-diff.php Looks, even more promising.
See Question&Answers more detail:os