age php datetime code example
Example 1: age php datetime
function get_age( $date ) {
$age = date('Y') - $date;
if (date('md') < date('md', strtotime($date))) {
return $age - 1;
}
return $age;
}
Example 2: age php datetime
function get_age( $date ) {
$age = date('Y') - $date;
if (date('md') < date('md', strtotime($date))) {
return $age - 1;
}
return $age;
}