Have a look at this, if you need something more precise:
Code:
function bfrMin($foo, $bar)
{
$foo = $foo == '' ? '00-00-0000' : $foo;
$bday = explode('-', $foo);
$year = vbdate('Y', TIMENOW, false, false);
$month = vbdate('n', TIMENOW, false, false);
$day = vbdate('j', TIMENOW, false, false);
if ($year > $bday[2] AND $bday[2] != '0000')
{
$age = $year - $bday[2];
if ($month < $bday[0] OR ($month == $bday[0] AND $day < $bday[1]))
{
$age--;
}
}else{
return 0;
}
return $age >= $bar ? 2 : 1;
}
$foo must contain the user's birthday in 00-00-0000 format.
$bar must contain a minimum age.
So, this: bfrMin('01-01-1989', 15)
Would return
0 if the user hasn't supplied a birthday to vBulletin,
1 if the user is younger than 15 years, or
2 if the user is 15 years old or older.