SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. function flatten2d($multi_dimensional_array) {
  4.   $flattened = [];
  5.   $flatten = function($value, $index) {
  6.     global $flattened;
  7.     array_push($flattened, $value);
  8.   };
  9.   array_walk_recursive($multi_dimensional_array, $flatten);
  10.   return $flattened;
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top