[Solved] How can obtain age by birth date [closed]


Using unix timestamps to handle birthdates is a bad idea, as their range is only very limited (1970-2038). Use php’s builtin DateTime class instead:

$then = DateTime::createFromFormat("Y/m/d", "2011/12/16");
$diff = $then->diff(new DateTime());
echo $diff->format("%y year %m month %d day\n");

solved How can obtain age by birth date [closed]