function calc_age($d, $m, $y) { $age = date('Y') - $y; $_m = date('m'); if($_m < $m || ($_m == $m && date('d') < $d)) $age--; return $age; } echo calc_age(25, 08, 1987);