Page 1 of 1

getAge() - Classical

Posted: Tue Aug 30, 2005 5:28 am
by harrisonad
Hi,
I know this is funny but once again I want to relive this issue. I want to reduce it to one line.
My attempt goes like...

Code: Select all

$age = (date("Y") - $bday_year) - ($bday_month >= date("m") ? ($bday_day >= date("d") ? 0 : 1) : 1);
You are free to give your opinion on that.

Posted: Tue Aug 30, 2005 5:36 am
by n00b Saibot
harrisonad wrote:I want to reduce it to one line.
But It is one line :?
Maybe more explanation will be clearer...

Posted: Tue Aug 30, 2005 6:56 am
by pleigh
elimate some spaces, hehe.. :wink: