Home  >  Article  >  Backend Development  >  PHP calculates age (years old) based on birthday

PHP calculates age (years old) based on birthday

PHP中文网
PHP中文网Original
2017-03-22 16:53:384735browse

PHP calculates age (one year old) based on birthday

 $birthMonth || $currentMonth == $birthMonth && $currentDay >= $birthDay)
        $age++;

    return$age;
}
?>

The above introduces PHP to calculate age (one year old) based on birthday, including the content. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com) !

Related articles:

How to calculate age based on birthday in php

Example of how to calculate age/zodiac sign/constellation in php based on birthday

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn