Return to Snippet

Revision: 42612
at March 8, 2011 05:37 by flolam


Initial Code
$multimap = array(
    array("name"=>"value1"),
    array("name"=>"value2"),
    array("name"=>"value3")
);

$flatmap = array_map("array_pop",$multimap);

print_r($flatmap);

/*
Output:

Array
(
    [0] => value1
    [1] => value2
    [2] => value3
)
*/

Initial URL
http://www.php.net/manual/en/function.array-map.php#101791

Initial Description

                                

Initial Title
Flatten multidimensional array using array_map

Initial Tags
array

Initial Language
PHP