Hi,
I need to see how old my users are, I got thir birth day numbers like 1984-12-31 (Y-m-d). Im having trubble getting how old this person is in a string like: "24 years".
Plz help 🙂
[man]strtotime[/man], then just do the math
$bday = "1979-07-04"; $tday = strtotime($bday); if($tday == -1) { die("Date is too old"); } else { $years = ((time() - $tday)/31536000); echo floor($years)." years old"; }