Answers for "Arr::flatten() The Arr::flatten method flattens a multi-dimensional array into a single level array:"

0

Arr::flatten() The Arr::flatten method flattens a multi-dimensional array into a single level array:

use Illuminate\Support\Arr;

$array = ['name' => 'Joe', 'languages' => ['PHP', 'Ruby']];

$flattened = Arr::flatten($array);

// ['Joe', 'PHP', 'Ruby']
Posted by: Guest on August-20-2021

Browse Popular Code Answers by Language