jahem/lucky

1.0.0 2019-08-06 03:49 UTC

This package is auto-updated.

Last update: 2024-06-06 14:57:40 UTC


README

一个简单的抽奖内库

install

composer require jahem/lucky

demo

<?php
	require 'vendor/autoload.php';
	use lucky\lucky;
	$prize_arr = [
        '0' => [ 
            'id' => 1,
            'chance' => 90
            ],
        '1' => [
            'id' => 2,
            'chance' => 1
            ],
        '2' => [
            'id' => 3,
            'chance' => 0
            ],
        '3' => [
            'id' => 4,
            'chance' => 0
            ],
        '4' => [
            'id' => 5,
            'chance' => 0
            ],
    ];
	$lucky = new lucky($prize_arr);
	var_dump($lucky->start());
?>