2017 © Pedro Peláez
 

library bias-random

Random element(s) with weight

image

wataridori/bias-random

Random element(s) with weight

  • Friday, February 5, 2016
  • by wataridori
  • Repository
  • 1 Watchers
  • 2 Stars
  • 1,439 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 11 % Grown

The README.md

BiasRandom for PHP

StyleCI Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Requirement

  • PHP >= 5.4

Install

You can install and manage BiasRandom by using Composer, (*2)

composer require wataridori/bias-random

Or add wataridori/bias-random into the require section of your composer.json file then run composer update, (*3)

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., (*4)

The Versions

05/02 2016

dev-master

9999999-dev

Random element(s) with weight

  Sources   Download

GPL-3.0

by Tran Duc Thang

18/03 2015

v0.1.0

0.1.0.0

Random element(s) with weight

  Sources   Download

GPL-3.0

by Tran Duc Thang

18/03 2015

v0.0.1

0.0.1.0

Random element(s) with weight

  Sources   Download

GPL-3.0

by Tran Duc Thang