我有个数组里面是[a,b,c] 随机获取一个值后,如a 下次数组只剩[b,c] 再从b,c里取,取完为止,求代码
4条回答
threenewbee 2019-06-06 17:18关注如果问题得到解决,请点采纳,谢谢
<?php $input = array("a", "b", "c", "d", "e"); shuffle($input); $i = 1; foreach ($input as $item) { echo "第".strval($i)."次取出".$item." "; } ?>解决 无用评论 打赏 举报