I am trying to write a function that calculates the age of an individual exactly...not worried about month or days just years...every php function I have tried to use only calculates back to 1970...therefore anyone born before 1970 would show an age of 32. I need this function to be able to calculate the age of someone born back in the early 1880's and later...I have thought of just a basic calculation like this:
but it will still be inaccuarate....any ideas???PHP Code:function calculate_age($year)
{
$today = getdate();
$tyear = $today['year'];
$age = $tyear - $year;
return $age;
}


Reply With Quote