Laravel 8 Arr::flatten() {#collection-method}
2021-07-19 10:18 更新
Arr::flatten
函数将多维数组中数组的值取出平铺为一维数组:
use Illuminate\Support\Arr;
$array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']];
$flattened = Arr::flatten($array);
// ['Joe', 'PHP', 'Ruby']
以上内容是否对您有帮助:
更多建议: