PHPackages                             hahadu/lottery-function - 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. hahadu/lottery-function

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

hahadu/lottery-function
=======================

基本抽奖算法

v0.2.1(2y ago)028Apache-2.0PHPPHP &gt;=7.3

Since Jul 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hahadu/php-lottery)[ Packagist](https://packagist.org/packages/hahadu/lottery-function)[ RSS](/packages/hahadu-lottery-function/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

php-lottery
===========

[](#php-lottery)

lottery base class

```
array[id] id
array[prize] name
array[prorate] 中奖率 为0永远不中，100必中 数组中中奖率总和=100%

```

```
    $prize_arr = [

        ['id'=>1,'prize'=>'平板电脑','prorate'=>1],
        ['id'=>2,'prize'=>'数码相机','prorate'=>5],
        ['id'=>3,'prize'=>'音箱设备','prorate'=>10],

        ['id'=>4,'prize'=>'4G优盘','prorate'=>12],

        ['id'=>5,'prize'=>'10Q币','prorate'=>22],

        ['id'=>6,'prize'=>'下次没准就能中哦','prorate'=>50],

    ];

    $lottery = (new Lottery());
    dump($lottery->run($prize_arr));
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Total

2

Last Release

992d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8803f4b62a77e88a2b14f57d7d68a5bacaa69fd8c58b17101e89044fab8abb27?d=identicon)[hahadu](/maintainers/hahadu)

---

Top Contributors

[![hahadu](https://avatars.githubusercontent.com/u/38153732?v=4)](https://github.com/hahadu "hahadu (9 commits)")

### Embed Badge

![Health badge](/badges/hahadu-lottery-function/health.svg)

```
[![Health](https://phpackages.com/badges/hahadu-lottery-function/health.svg)](https://phpackages.com/packages/hahadu-lottery-function)
```

###  Alternatives

[phannaly/php-datetime-khmer

The PHP library for convert datetime to Khmer

1510.3k](/packages/phannaly-php-datetime-khmer)[moosend/website-tracking

By installing the Moosend PHP Tracking library you are can track page views, product views, add to cart events and successful purchases. You can later use these details to segment your user base, run automations, check how successful your latest promo has been and how many conversions your landing page has led to.

1020.9k1](/packages/moosend-website-tracking)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
