php从数组中随机抽取一些元素的代码

时间:2020-12-19 17:11:49
【文件属性】:
文件名称:php从数组中随机抽取一些元素的代码
文件大小:29KB
文件格式:PDF
更新时间:2020-12-19 17:11:49
hp php 数组 复制代码 代码如下: <?php class getValues { public function inputValue($inputArray) { $this->inputArray = $inputArray; } public function getValue($number) { $this->number = $number; for($i = 0; $i < $this->number; $i ++) { $index = rand ( 0, count ( $this->inputArray ) – 1 – $i ); $getArray [$i] = $this->inp

网友评论