calculate person age by birthdate php

 public function getAge($date)
    {
        
        $dob = new DateTime($date);
        
        $now = new DateTime();
         
        $difference = $now->diff($dob);
         
        $age = $difference->y;
         
        return  $age;
    }

3.71
7
Boehmi 120 points

                                    function get_age( $date ) { 
    $age = date('Y') - $date; 
   if (date('md') < date('md', strtotime($date))) { 
       return $age - 1; 
   } 
   return $age; 
} 

3.71 (7 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
calculate date of birth php how to get birth date php php calculate age from dat php age php datetime calculate age calculate age from date in php php date_of_birth get age php age from date age.php find age from date of birth php PHP how to calculate age using birthdate only how to calculate age from database in php get age from date php get age from date of birth in php How to calculate age by date of birth using PHP Programming how to calculate age on date in php how to get total age using date of birth in php how to get age from date of birth in php how to calculate age in php from date of birth count age from date of birth php get person's age in month using date of birth php calculate age in years using date of birth php calculate age php date birth program to calculate age in php calculate birthay php calculate date of birth from date in php php calculate age from dateof birth calculate age from date of birth in php calculate age in php how to calculate average age from date of birth php php birth date by age calculate age with date of birth php age of php function php get age age calculate in php show age from birth php age php age in php function calculate age php how to calculate age from date of birth in php php get age from birthdate how to count age from date of birth in php <?php("AGE",);?> how to query where by age from date of birth in php php age to date find age from date of birth in php calculate age from date of birth php date calculate formula in php how to calculate age with date of birth php how to convert date of birth into age php php date to age extract age by a data php php function to calculate age from date of birth php age from birthdate get age by date php php get years old from date php data a month age sum of birth date php php calculate age by date of birth get user age using php convert number to age php date of birth find age in php my age in php php ages php calculate 18 years from now calculate current age php age function php php get old age php dateof birth age difference between dates php php birthday date to timestamp php birth date age calculator php php count age from date of birth php calculate age based on year php date calculate age print user age when they enter birth date php get age from date of birth php php age from dob php age calculator php how to calulate your age php get age from dob php calculate age from date php how to check where birth date defined get years in php with born date age calculation in php form calculate age from date php php calculate age from birthdate php get current age from 2 dates php calculayt age from timestemp function to calculate age in php birth of date in php get age from date with php php get age from date find current age in php calculating age 60 or above base in date of birth using php calculating age <=60 php mysql php date age calculation age from date function php php age calculation calculate age php how to calculate age in php php calc age year and month php calcalute age php get age brom date of birth find age from date in php php age counting calculate person age by birthdate php php age php get age from birthday php calcute age ising birth year date of birth to age php php date of birth to age php calculate age from date of birth php calculate age php check dob age with php datetime age php datetime
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source