Hi I'm tying to get php to calculate someone's age from that person's birthday, for example 1985-04-11 the age would be 20 anyone can tell me how I could do that? Thanks!

I have a simple PHP one-liner for calculating age. You don't need anything complicated.

$age = floor((time() - strtotime($birthdate))/(60*60*24*365.2425));

Check it out: Calculating Age in PHP

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.