Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

flatten a multi-dimensional array into a single array in php

//The array_flatten function will flatten a multi-dimensional array into a single level
$array = ['name' => 'Issac', 'languages' => ['PHP', 'Python']];
$array = array_flatten($array);
// ['Issac', 'PHP', 'Python'];
Source by laravel.com #
 
PREVIOUS NEXT
Tagged: #flatten #array #single #array #php
ADD COMMENT
Topic
Name
5+7 =