生日转年龄
作者:互联网
function birthday2age($birthday='1949-10-01'){
list($year,$month,$day)=explode('-',$birthday);
$year_diff=date('Y')-$year;
$month_diff=date('m')-$month;
$day_diff=date('d')-$day;
if($day_diff<0||$month_diff<0)$year_diff--;
return $year_diff;
}
标签:month,birthday,year,date,diff,生日,年龄,day 来源: https://www.cnblogs.com/sunr/p/16672212.html