How to calculate (show, print) people (human) age using php?

How to calculate (show, print) people (human) age using php?

function prigVozrFizVau($darr,$dob){
$dateOfBirth = date("Y-m-d",strtotime($dob));
$today = date("Y-m-d",strtotime($darr));
$diff = date_diff(date_create($dateOfBirth), date_create($today));

return $diff->format('%y');
}

Article Details

Article ID:
62
Category:
Date added:
14.01.2022 16:08:46
Views:
16,690
Rating (Votes):
(0)

Related articles