Avatar

How to get age from given birthdate

1
2
3
4
5
<?php
function getAge($birthdate) {
    return floor((time() - strtotime($birthdate))/(60*60*24*365.2425));
}
?>

Refactorings

No refactoring yet !

Your refactoring





Format Copy from initial code

or Cancel