|
|
#1 (permalink) |
|
New Member
![]() Join Date: Sep 2008
Posts: 5
|
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:
|
|
|
|
|
|
#2 (permalink) |
|
New Member
![]() Join Date: Nov 2008
Posts: 2
|
Your syntax appears correct. You just need to take out the negative sign or you need the absolute value. Luckily, php comes with tons of handy math functions at your disposal and unfortunately, you only need one. abs() is the function.
Code:
$days = abs($ff - $ee); Cheers, Jonathan |
|
|
|
|
|
#3 (permalink) | |
|
New Member
![]() Join Date: Nov 2008
Posts: 9
|
no, abs() will not show up the correct answer.
Calculations must be performed more carefuly and step by step. Try to kick this: Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|