The code i posted above doesn't calculate the age accurately...for instance if i wanted the age of someone born on Dec. 07, 1969 it calculates the age as 33, but their actually 32...thats what i meant by not calculating it accurately.
Here is the function I wrote that calculates the age accurately if anyone is interested.
It will calculate the age for someone born in the year 1 A.D. to now.
function calculate_age($m, $d, $y)
{
$now = getdate();
$nmonth = $now['month'];
$nday = $now['mday'];
$nyear = $now['year'];
if ($nmonth < $m OR $nmonth = $m AND $nday < $d) {
$age = $nyear - $y - 1;
} else {
$age = $nyear - $y;
}
return $age;
}