PHPackages                             endroid/priority-shuffle-random - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. endroid/priority-shuffle-random

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

endroid/priority-shuffle-random
===============================

Endroid Priority Shuffle Random

2.0.3(6y ago)21.7kMITPHPPHP &gt;=7.2

Since Oct 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/endroid/priority-shuffle-random)[ Packagist](https://packagist.org/packages/endroid/priority-shuffle-random)[ Docs](https://github.com/endroid/priority-shuffle-random)[ GitHub Sponsors](https://github.com/endroid)[ RSS](/packages/endroid-priority-shuffle-random/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

Priority Shuffle Random
=======================

[](#priority-shuffle-random)

*By [endroid](https://endroid.nl/)*

[![Latest Stable Version](https://camo.githubusercontent.com/d4c789ac10ac0c7729ad869a3e627c74f775a36cabfc8c36b6a40519fb7ff997/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656e64726f69642f7072696f726974792d73687566666c652d72616e646f6d2e737667)](https://packagist.org/packages/endroid/priority-shuffle-random)[![Build Status](https://github.com/endroid/priority-shuffle-random/workflows/CI/badge.svg)](https://github.com/endroid/priority-shuffle-random/actions)[![Total Downloads](https://camo.githubusercontent.com/585b14ce8a5a9033de0b4b8f2d4bff998bf190cf63a34b62e41e80df5bfa9234/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656e64726f69642f7072696f726974792d73687566666c652d72616e646f6d2e737667)](https://packagist.org/packages/endroid/priority-shuffle-random)[![Monthly Downloads](https://camo.githubusercontent.com/b09103aa5a133ed1ef3760fcf75e7e9f0c2c965d40f39b8f0c1115a3655f3d6a/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f656e64726f69642f7072696f726974792d73687566666c652d72616e646f6d2e737667)](https://packagist.org/packages/endroid/priority-shuffle-random)[![License](https://camo.githubusercontent.com/750681bd8e588fb80db104996e08cce044ff437e8e7eab67bf96af9287fe9a75/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656e64726f69642f7072696f726974792d73687566666c652d72616e646f6d2e737667)](https://packagist.org/packages/endroid/priority-shuffle-random)

This library extends the basic random functionality by ensuring that the appearance of items is evenly distributed while respecting their priority. Items with priority 3 will be shown three times as often as items with priority 1, while the shuffle algorithm ensures that the values are spreaded nicely.

Installation
------------

[](#installation)

Use [Composer](https://getcomposer.org/) to install the library.

```
$ composer require endroid/priority-shuffle-random
```

Usage
-----

[](#usage)

```
