Download the PHP package bentools/picker without Composer
On this page you can find all versions of the php package bentools/picker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download bentools/picker
More information about bentools/picker
Files in bentools/picker
Download bentools/picker
More information about bentools/picker
Files in bentools/picker
Vendor bentools
Package picker
Short Description Helps you pick a random item with weight management.
License MIT
Package picker
Short Description Helps you pick a random item with weight management.
License MIT
Please rate this library. Is it a good library?
Informations about the package picker
Picker
A PHP library for randomly picking items from collections and generating random numbers with advanced options like seeding, weighting, and more.
Features
- Pick random items from collections
- Generate random numbers with optional seeding
- Support for weighted item selection
- Option to allow or prevent duplicates in selections
- Consistent results with seeded randomization
Quick Start
Picking Items from a Collection
Basic usage
Prevent duplicates
It will avoid, as much as possible, picking the same item twice in a row.
If all items have been picked, it will cycle through them again.
Direct Number Generation
Advanced Usage
Item Picker Options
Use Cases
- Randomizing elements in games
- Implementing A/B testing
- Creating fair selection mechanisms
- Generating random but reproducible test data
- Implementing weighted random selection for various algorithms
Installation
This library requires PHP 8.2+.
composer require bentools/picker
Tests
./vendor/bin/pest
See also
All versions of picker with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2
The package bentools/picker contains the following files
Loading the files please wait ....