Skip to content

Instantly share code, notes, and snippets.

@c-kick
Created November 17, 2014 21:43
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save c-kick/1dfcdc91334a7de3a7af to your computer and use it in GitHub Desktop.
Limit integer to a min and max
function valBetween($val, $min, $max) {
return (Math.min($max, Math.max($min, $val)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment