hello,
is there a function that could check if a given number is in a range of other numbers?
Something like:
Does such a function exists?PHP Code:$number = 43;
if (in_range(25-50, $number)){
//do something
}
![]()
| SitePoint Sponsor |





hello,
is there a function that could check if a given number is in a range of other numbers?
Something like:
Does such a function exists?PHP Code:$number = 43;
if (in_range(25-50, $number)){
//do something
}
![]()



None that I am aware of.
Something like that should be sufficient I assume.PHP Code:function inRange($valueToCheck, $lowerLimit, $upperLimit) {
if ($valueToCheck >= $lowerLimit && $valueToCheck <= $upperLimit)
return true;
else
return false;
}
![]()





hey thanks![]()
Bookmarks