阅读(3776)
赞(9)
Laravel 8 Arr::flatten() {#collection-method}
2021-07-02 16:49:00 更新
Arr::flatten
函数将多维数组中数组的值取出平铺为一维数组:
use Illuminate\Support\Arr;
$array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']];
$flattened = Arr::flatten($array);
// ['Joe', 'PHP', 'Ruby']