Skip to content

jbrooksuk/php-clamp

Repository files navigation

PHP Clamp

Clamp one number between a min and max.

Usage

// $number = clamp($value, $min, $max);

clamp(10, 1, 100); // => 10
clamp(10, 1, 5); // 5
clamp(-10, 1, 5); // 1

License

PHP Clamp is licensed under The MIT License (MIT).

About

Clamp one number between a min and max.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages