Last active
September 23, 2015 21:47
-
-
Save tonylegrone/621037 to your computer and use it in GitHub Desktop.
Detects if an integer is between the provided 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 | |
/** | |
* Detects if an integer is between the provided range. | |
* | |
* @param int $int | |
* The integer to test against. | |
* @param int $min | |
* The minimum number $int can be. | |
* @param int $max | |
* The maximum number $int can be. | |
* | |
* @return bool | |
* TRUE if $int is within the range of $min and $max; FALSE if it is not. | |
*/ | |
function between($int, $min, $max) { | |
return ($int >= $min && $int <= $max); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment