Calculate Age using PHP (mounth-day-year to age)
Copy this code and paste it in your HTML
# mounth-day-year
function getAge($date){
$bday = mktime(0,0,0,$bday[0],$bday[1],$bday[2]); $age = (int
)((time()-$bday)/31556926 ); return $age;
}
#eg:
echo getage("03-27-1990"); # returns the age.
Report this snippet
Comments
Subscribe to comments