Answers for "php function to calculate age from date of birth"

PHP
1

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;
    }
Posted by: Guest on July-11-2020

Code answers related to "php function to calculate age from date of birth"

Browse Popular Code Answers by Language