quick PHP question..

f1sh3r

Senior member
Oct 9, 2004
636
0
0
i know i should probably have a function somewhere to do this already, but i dont. anyone have a simple function that takes a DATE from mySQL and returns the current age?

it would be used as follows:

showage($row['dob'])

of course $row['dob'] is a variable passed from a query in DATE format.

i tossed this together, but is there an easier way? btw, it for puppy ages, so weeks is all i really need. eh, maybe months.