note 33468 deleted from function.mktime by sniper
| From: | sniper@php.net | Date: | Tue, 04 Nov 2003 13:10:12 +0000 |
| Subject: | note 33468 deleted from function.mktime by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-59867@lists.php.net to get a copy of this message | ||
Note Submitter: wahoo@cyberdreamers.org
----
my 2 cents for the 'most-elegant-way-to-get-someone's-age':
function age($bday)
{
$c = getdate(); /* current */
$b = getdate($bday); /* birthday */
$age = $c[year] - $b[year];
if (time() < mktime($b[hours], $b[minutes], $b[seconds], $b[mon], $b[mday], $c[year]))
{
$age--;
}
return $age;
}