php 나이로 생년월일 구하기
페이지 정보
작성자
본문
나이로 생년구하기 함수 이다.
몇년도에 태어났는지 확인해 볼 수 있다.
몇년도에 태어났는지 확인해 볼 수 있다.
function getBirth($age) {
$birth = date('Y') - $age + 1;
if (date('md') < $birth[1] . $birth[2]) {
$birth--;
}
return $birth;
}
echo getBirth(31);
----- Output -----
1992
댓글목록
등록된 댓글이 없습니다.