Skip to content

Instantly share code, notes, and snippets.

@c-kick
Created November 17, 2014 21:43
Show Gist options
  • Save c-kick/1dfcdc91334a7de3a7af to your computer and use it in GitHub Desktop.
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