Using RecursiveIterator to flatten my multi array not working?
<p>This returns null even if the input array is not null:</p>

<pre><code>function flattenArray($multi_array)
{ 
  $flat_array = array();
  foreach(new RecursiveIteratorIterator(new RecursiveArrayIterator($multi_array)) as $k =&gt; $v) 
  { 
    $flat_array[$k] = $v;
  }

  return $flat_array;
}
</code></pre>

<p>Any ideas why?</p>
