xcandiottix Posted June 9, 2010 Share Posted June 9, 2010 So i'm working on a submission form and I'd like to get users birthday. Afterwards though I would like a php script to be able to kick back that X user is X years old. I have a javascript form built that has a drop down for each month, day, and year. When I save it to the database whats the best way to do it so that php can easily relate that to a year of age. I know there's a lot of date functions in php but i'm confused as to the best way to go about it. I'm thinking: Javascript outputs to mysql 11091982 (11/09/1982) PHP takes todays date ... can i use date(m,d,y)? and subtracts 11091982 and comes up with $age=27 ?? Thanks Link to comment https://forums.phpfreaks.com/topic/204308-most-effiecnt-way-to-work-in-a-b-day/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.