birthday format is YYYY-MM-DD
function age($birthDay) {
list($y, $m, $d) = explode('-', $birthDay);
if (($m = (date('m') - $m)) < 0) {
$y++;
} elseif ($m == 0 && date('d') - $d < 0) {
$y++;
}
return date('Y') - $y;
}