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
Sniper007
Forum Newbie
Posts: 17 Joined: Tue May 11, 2004 8:43 pm
Post
by Sniper007 » Tue May 18, 2004 9:25 pm
If I had 10 variables that were holding 10 different timestamps, and I wanted to compare them to find out which variable had the oldest timestamp, how would I go about that?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue May 18, 2004 9:33 pm
tim
DevNet Resident
Posts: 1165 Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio
Post
by tim » Tue May 18, 2004 9:35 pm
max() function would be your best bet
/ edit
ahh beaten to it, kudos feyd.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue May 18, 2004 9:39 pm
markl999
DevNet Resident
Posts: 1972 Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)
Post
by markl999 » Tue May 18, 2004 10:47 pm
Just to be picky...but if you wanted the oldest timestamp, then that would be the one with the smallest value. So
min() might be better than max
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue May 18, 2004 10:54 pm
heh oops.. my bad. Good catch mark.
Sniper007
Forum Newbie
Posts: 17 Joined: Tue May 11, 2004 8:43 pm
Post
by Sniper007 » Wed May 19, 2004 8:49 am
"I love all you guys!! ...Especially you... aaaaahhh... AHAHAHAHA!"
-Tommy Boy