您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP根据生日计算年龄(周岁)

2026/1/4 0:15:38发布24次查看
php根据生日计算年龄(周岁)
<?php/** * 根据时间戳计算年龄 * @param $birth * @return mixed */functionhowold($birth) {list($birthyear, $birthmonth, $birthday) = explode('-', date('y-m-d', $birth)); list($currentyear, $currentmonth, $currentday) = explode('-', date('y-m-d')); $age = $currentyear - $birthyear - 1; if($currentmonth > $birthmonth || $currentmonth == $birthmonth && $currentday >= $birthday) $age++; return$age; } ?>
以上就介绍了php根据生日计算年龄(周岁),包括了方面的内容。
相关文章:
php根据生日计算年龄的方法
php根据生日计算年龄/生肖/星座实例
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product