| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Sep 2008
Posts: 13
|
How to take out user's AGE in PHP?
This code i have made to take out age of the user(the date in the mktime is just for testing). But many problems are occurring like if the user was born on 2nd of a month today is 1st of a month then the date comes in minus (-) which makes it too confusing... After all, i m completely stuck & confused. Please tell how to take out users age. PHP Code:
|
|
|
|
|
|
#5 (permalink) |
|
I like code.
|
Yeah, I'm not sure what it is but mktime returns the month as 12. If I change the day to 09 the month changes to 11. Anthing over Aug 9th renders the month as 12. Edit: Find a function online that seems to do what you want. time since [date] [php] [time] [since] Last edited by Cborrow : 12-09-2008 at 14:24. |
|
|
|
#6 (permalink) |
|
Design Destroyer
Join Date: Aug 2008
Location: Somewhere in Universe
Posts: 198
|
try this PHP Get Age Function | Trevor Davis My-PHP.tk ••• Your Free PHP Resource! ••• or google for "age php function" SIGNATURE ?
|
|
|
|
#7 (permalink) |
|
trained to kill
|
PHP Code:
Remember date() accepts US dates by default so 4/11/1984 in US is 11/04/1984. look at php.net/date for formatting options. |
|
![]() |
|