Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbrooksuk/php-clamp
Clamp one number between a min and max.
https://github.com/jbrooksuk/php-clamp
php
Last synced: about 8 hours ago
JSON representation
Clamp one number between a min and max.
- Host: GitHub
- URL: https://github.com/jbrooksuk/php-clamp
- Owner: jbrooksuk
- License: mit
- Created: 2020-08-20T14:39:26.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-28T10:18:10.000Z (about 4 years ago)
- Last Synced: 2024-09-15T08:26:33.804Z (19 days ago)
- Topics: php
- Language: PHP
- Homepage: https://james.brooks.page
- Size: 18.6 KB
- Stars: 13
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# PHP Clamp
Clamp one number between a min and max.
## Usage
```php
// $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)](/LICENSE).