Skip to content

Instantly share code, notes, and snippets.

@sergey-fritzler
Last active August 31, 2016 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergey-fritzler/b3db69b1f75f3807460e752c352bd1c6 to your computer and use it in GitHub Desktop.
Save sergey-fritzler/b3db69b1f75f3807460e752c352bd1c6 to your computer and use it in GitHub Desktop.
Checks if a value exists in an range
<?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