Answers for "print user age when they enter birth date php"

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 "print user age when they enter birth date php"

Browse Popular Code Answers by Language