- var_dump: documentation ( source)
- abs: documentation ( source)
- time: documentation ( source)
- floor: documentation ( source)
- strtotime: documentation ( source)
<?php
$dt = '1990-07-22 00:00:00';
$year_calc = 60 * 60 * 24 * 365;
$year_strict = 31556926;
var_dump([
'year_calc' => $year_calc,
'year_strict' => $year_strict,
'now' => time(),
'age_calc' => floor(abs((time() - strtotime($dt))/$year_calc)),
'age_strict' => floor(abs((time() - strtotime($dt))/$year_strict)),
]);