- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$bithdayDate = "1993-08-20";
$tdate = date("Y-m-d");
$age = 0;
while( $tdate > $dob = strtotime('+1 year', $bithdayDate))
{
++$age;
}
echo $age;
$bithdayDate = "1993-08-20";
$date = new DateTime($bithdayDate);
$now = new DateTime();
$interval = $now->diff($date);
echo $interval->y;