I'm trying to calculate age. I'm using this code and it works great for the sample birthdate, but I can't figure out how to get $birthDate to equal my three separate variables $day, $month, $year that are stored in my database for each user. How would I do this so $birthDate = $day/$month/$year and works with the age calculator below?
<?php
$birthDate = "12/17/1983";
$birthDate = explode("/", $birthDate);
$age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md") ? ((date("Y")-$birthDate[2])-1):(date("Y")-$birthDate[2]));
echo "Age is:".$age;
?>