wataridori/bias-random
最新稳定版本:v0.1.0
Composer 安装命令:
composer require wataridori/bias-random
包简介
Random element(s) with weight
README 文档
README
Requirement
- PHP >= 5.4
Install
You can install and manage BiasRandom by using Composer
composer require wataridori/bias-random
Or add wataridori/bias-random into the require section of your composer.json file then run composer update
Usage
$biasRandom = new wataridori/BiasRandom/BiasRandom(); $data = [ 'wataridori' => 10, ]; $biasRandom->setData($data); $biasRandom->addElement('Tran', 20); $biasRandom->addElement('Duc', 30); $biasRandom->addElement('Thang', 40); // Random one element with weight. $biasRandom->random(); // Random two elements $biasRandom->random(2);
Test
Just run phpunit to start test.
统计信息
- 总下载量: 20.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-03-18