Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel collection flatten

$collection = collect(['name' => 'taylor', 'languages' => ['php', 'javascript']]);

$flattened = $collection->flatten();

$flattened->all();

// ['taylor', 'php', 'javascript'];
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #laravel #collection #flatten
ADD COMMENT
Topic
Name
4+8 =