- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
function personGetAge($birthday) {
$m = intval(substr($birthday, 5, 2));
$d = intval(substr($birthday, 8, 2));
$y = intval(substr($birthday, 0, 4));
$age = time() - mktime(12, 0, 0, $m, $d, $y);
return floor($age / (60*60*24*365.2425));
}