if (!function_exists('get_age')){
function get_age($birthday){
$iage = 0;
$year = date('Y',strtotime($birthday));
$month = date('m',strtotime($birthday));
$day = date('d',strtotime($birthday));
$now_year = date('Y');
$now_month = date('m');
$now_day = date('d');
if ($now_year > $year) {
$iage = $now_year - $year - 1;
if ($now_month > $month) {
$iage++;
} else if ($now_month == $month) {
if ($now_day >= $day) {
$iage++;
}
}
}
return $iage;
}
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END