jamesbrooks / php-clamp
Clamp one number between a min and max.
Fund package maintenance!
jbrooksuk
Installs: 469
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 3
Forks: 2
Open Issues: 0
pkg:composer/jamesbrooks/php-clamp
Requires (Dev)
- pestphp/pest: ^0.2.4
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-09-28 21:40:48 UTC
README
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).