<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>How to calculate age in php </title>
</head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<body>
<?php
$dateOfBirth = "17-09-1996";
$today = date("Y-m-d");
$diff = date_diff(date_create($dateOfBirth), date_create($today));
echo 'Age is '.$diff->format('%y') ."Year " .$diff->format('%m').' Month '.$diff->format('%d')." Days";
?>
</body>
</html>