Last active
August 31, 2016 09:28
-
-
Save sergey-fritzler/b3db69b1f75f3807460e752c352bd1c6 to your computer and use it in GitHub Desktop.
Checks if a value exists in an range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Checks if a value exists in an range | |
* | |
* @param int $value | |
* @param int $min | |
* @param int $max | |
* @return bool | |
*/ | |
function in_range($value, $min, $max) { | |
return ($min >= $value && $value <= $max); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment