Calculate the age of the person by the date of birth (php)


date_default_timezone_set('America/Los_Angeles'); function calculateAge($birthday){ return floor((time() - strtotime($birthday))/31556926); } //USAGE EXAMPLES echo calculateAge('1978-07-11'); echo calculateAge('7/11/1978'); echo calculateAge('7/11/78'); echo calculateAge('July 11, 1978'); А here example of such a script.