php年龄计算函数
php年龄计算函数 [代码片段(9行)]
function birthday ($birthday){ 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; }
- 上一篇:文件搜索 php显示文件夹下的所有图片代码片段
- 下一篇:分页 php自定义分页类
精彩图集
精彩文章