note 55543 deleted from function.date by derick
| From: | derick@php.net | Date: | Sun, 15 Jan 2006 12:43:46 +0000 |
| Subject: | note 55543 deleted from function.date by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101833@lists.php.net to get a copy of this message | ||
Note Submitter: djneoform at gmail dot com
----
here's a function to get (in years) a person's age based on their birthday
function persons_age($year, $month, $day)
{
$tmonth = date('n');
$tday = date('j');
$tyear = date('Y');
$years = $tyear - $year;
if ($tmonth <= $month)
{
if ($month == $tmonth)
{
if ($day > $tday)
$years--;
}
else
$years--;
}
return $years;
}