Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/271.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 随机项目表从低概率到高概率开始_Php_Mysql - Fatal编程技术网

Php 随机项目表从低概率到高概率开始

Php 随机项目表从低概率到高概率开始,php,mysql,Php,Mysql,我想从一张桌子上得到一件物品,从低概率到高概率 当如chance=100和chance=100时,只返回一项: $table = [itemid=23,chance=55],[itemid=55,chance=100],[itemid66,chance=100],[itemid=5,chance=1] rand($table[0]-1,$table[1]-2); 好名字;)。。。。。好名字;)。。。。。

我想从一张桌子上得到一件物品,从低概率到高概率 当
如chance=100
chance=100
时,只返回一项:

$table = [itemid=23,chance=55],[itemid=55,chance=100],[itemid66,chance=100],[itemid=5,chance=1]
rand($table[0]-1,$table[1]-2);
好名字;)。。。。。好名字;)。。。。。