Calculate age from date of birth in php | Age calculator code in PHP

So many time we need to calculate user age from date of birth of the user. Here I'm giving an example code in PHP. I have written a function getAge() and you just need to pass the date of birth of the user in a given format. You will get the age of the user.

 

Share This:

2 thoughts on “Calculate age from date of birth in php | Age calculator code in PHP

  1. Scryde

    So, in this case, birthdate is supplied as the start_date from cell D4, and today's date is supplied as the end_date, courtesy of the TODAY function.

Leave a Reply

Your email address will not be published. Required fields are marked *