age.php
· 158 B · PHP
Originalformat
<?php
function age($year, $month, $day) {
$diff = date_diff(date_create($year.'-'.$month.'-'.$day), date_create(date('Y-m-d')));
return $diff->y;
}
?>
| 1 | <?php |
| 2 | |
| 3 | function age($year, $month, $day) { |
| 4 | $diff = date_diff(date_create($year.'-'.$month.'-'.$day), date_create(date('Y-m-d'))); |
| 5 | return $diff->y; |
| 6 | } |
| 7 | |
| 8 | ?> |