note 19237 added to function.mktime

From: Date: Wed, 20 Feb 2002 15:18:00 +0000
Subject: note 19237 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-26848@lists.php.net to get a copy of this message
to work out how old someone is in years that also accounts for people born before 1970 (developed on a win32 platform) i used: $intDOBday = "21"; $strDOBmonth = "feb"; $intDOByear = "1981"; $dob = "$intDOBday$strDOBmonth$intDOByear"; $age = date("Y") - substr($dob,-4); if ($a_M[substr($dob,2,3)] > $a_M[strtolower(date("M"))]) --$age; if ($a_M[substr($dob,2,3)] == $a_M[strtolower(date("M"))]) { if(floor(substr($dob,0,2)) > floor(date("d"))) --$age; } echo "final age = $age"; -- http://www.php.net/manual/en/function.mktime.php http://master.php.net/manage/user-notes.php?action=edit+19237 http://master.php.net/manage/user-notes.php?action=delete+19237 http://master.php.net/manage/user-notes.php?action=reject+19237

« previous php.notes (#26848) next »