Laravel 8 Arr::shuffle() {#collection-method}
Arr::shuffle
函数将数组中值进行随机排序:
use Illuminate\Support\Arr;
$array = Arr::shuffle([1, 2, 3, 4, 5]);
// [3, 2, 5, 1, 4] - (generated randomly)
Arr::shuffle
函数将数组中值进行随机排序:
use Illuminate\Support\Arr;
$array = Arr::shuffle([1, 2, 3, 4, 5]);
// [3, 2, 5, 1, 4] - (generated randomly)