Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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;
    }
 
PREVIOUS NEXT
Tagged: #calculate #person #age #birthdate #php
ADD COMMENT
Topic
Name
1+7 =