...

View Full Version : determining if a number is between others



poysyn
01-17-2010, 09:13 PM
how can i compare 2 dates with a week ago?

i just want to know if there is a way to determine whether 4 is in between 1-10 basically. is it possible?

thank you in advance =)
poysyn

Zoic
01-17-2010, 09:18 PM
Something like this?


$number = 4;
$min = 1;
$max = 10;

if ($number > $min && $number < $max) {
// do something
}

Just simple math there. :P

If not, perhaps you could be more specific about what it is your trying to accomplish?

masterofollies
01-17-2010, 10:11 PM
I actually use a week date in my coding.


$nextWeek = time() + (7 * 24 * 60 * 60);
echo "This Week: (". date('Y-m-d') .")";
echo "Next Week: (". date('Y-m-d', $nextWeek) .")";

JAY6390
01-18-2010, 02:15 AM
As Zoic says you need to be more specific. Your question is far too vague



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum