note 64289 deleted from function.date by derick
| From: | derick@php.net | Date: | Sun, 11 Jun 2006 11:45:49 +0000 |
| Subject: | note 64289 deleted from function.date by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-114262@lists.php.net to get a copy of this message | ||
Note Submitter: av01 at bugfix dot cc
----
Here is a little function I use to calculate the current age of a person based on his/her birthday.
Hope it comes handy to anyone.
// calculate age based on birthday
function getAge($birthday) // date time
{
return date('Y') - date('Y', $birthday) - 1 + (int)((date('m',
$birthday) <= date('m')) && (date('d', $birthday) <=
date('d')));
}
Cheers,
André