Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

Como faço para determinar facilmente a idade de um aniversário? (php)


Isso já foi perguntado antes. Tente isto:
function getAge($then) {
    $then = date('Ymd', strtotime($then));
    $diff = date('Ymd') - $then;
    return substr($diff, 0, -4);
}

Chame assim:
$age = getAge($aPersoonsgegevens['alg_persoonsgegevens_geboortedatum']);