PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
harrisonad
Forum Contributor
Posts: 288 Joined: Fri Oct 15, 2004 4:58 am
Location: Philippines
Contact:
Post
by harrisonad » Tue Aug 30, 2005 5:28 am
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.
Last edited by
harrisonad on Tue Aug 30, 2005 9:45 pm, edited 3 times in total.
n00b Saibot
DevNet Resident
Posts: 1452 Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:
Post
by n00b Saibot » Tue Aug 30, 2005 5:36 am
harrisonad wrote: I want to reduce it to one line.
But It is one line
Maybe more explanation will be clearer...
pleigh
Forum Contributor
Posts: 445 Joined: Wed Jan 19, 2005 4:26 am
Post
by pleigh » Tue Aug 30, 2005 6:56 am
elimate some spaces, hehe..