Search
 
SCRIPT & CODE EXAMPLE
 

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'];
Comment

php flatten multidimensional array

<?php

$notFlat = [[1,2],[3,4]];
$flat = array_merge(...$notFlat);
var_dump($flat);
Comment

PREVIOUS NEXT
Code Example
Php :: installing bootstrap ui in laravel app 
Php :: how to get data from a table in laravel 
Php :: PHP not working centos 8 
Php :: current time input field in laravel form 
Php :: cambiar entre versiones de php linux 
Php :: how to remove null values in array php 
Php :: remove all sessions in laravel 
Php :: Modes of file reading php 
Php :: laravel 8 route 
Php :: get current time in php 
Php :: laravel deleted controller still cached 
Php :: import facade URL laravel 
Php :: How to use my constants in Larvel 
Php :: check if object has method php 
Php :: php session destroy 
Php :: socialite laravel 7 
Php :: Clear from faild_jobs laravel 
Php :: migrate specific migration file laravel 
Php :: base64 enocode php 
Php :: drop all tables laravel 
Php :: How to check if email exists in laravel login 
Php :: php textarea replace newline with br 
Php :: current date in codeigniter 
Php :: subtract string php 
Php :: php select option selected from database 
Php :: How to get the current taxonomy term ID (not the slug) in WordPress? 
Php :: composer_update 
Php :: laravel validation decimal 
Php :: php group multidimensional array by value 
Php :: php remove string from array 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =