Posted By

flolam on 03/08/11


Tagged

array flatten multidimansional arraymap


Versions (?)

Flatten multidimensional array using array_map


 / Published in: PHP
 

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

  1. $multimap = array(
  2. array("name"=>"value1"),
  3. array("name"=>"value2"),
  4. array("name"=>"value3")
  5. );
  6.  
  7. $flatmap = array_map("array_pop",$multimap);
  8.  
  9. print_r($flatmap);
  10.  
  11. /*
  12. Output:
  13.  
  14. Array
  15. (
  16.   [0] => value1
  17.   [1] => value2
  18.   [2] => value3
  19. )
  20. */

Report this snippet  

You need to login to post a comment.