Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

convert 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: #convert #array #single #array #php
ADD COMMENT
Topic
Name
8+7 =