matthewbaggett/clamp
Composer 安装命令:
composer require matthewbaggett/clamp
包简介
PHP clamp function to clamp a number between a minimum and a maximum.
README 文档
README
PHP mathematical "Clamp" function. It clamps a variable between two numbers. Simple.
Usage:
$value = clamp( $min, // The minimum you will accept $max, // The maximum you can take $value // The value you wish to clamp );
Why?
I got sick of writing what should be a core PHP function into a Util class, only to discover other people populating that util class with other nonsense that really shouldn't be in a Util class.
统计信息
- 总下载量: 3.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-02-07