This one time, at band camp, "Mike Panchenko" <m...@mihasya.com> wrote:

> Hey everybody, I'm new both to the list and to hacking the internals, so
> I'll try to keep it short and humble.
> 
> I've written an array_flatten function which just takes all elements from a
> nested array and pushes them into a single indexed array.

function flattenArray(array $array){
   $ret_array = array();
   foreach(new RecursiveIteratorIterator(new RecursiveArrayIterator($array)) as 
$value)
   {
     $ret_array[] = $value;
   }
   return $ret_array;
  }

Kevin

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to