Posted By

paramah on 03/22/10


Tagged

php textmate array flat


Versions (?)

Flat array


 / Published in: Other
 

  1. public function flatArray($array)
  2. {
  3. foreach ($array as $key => $value)
  4. {
  5. if(is_array($value))
  6. {
  7. if(count($value) != 0) $out[$key] = $this->flatArray($value);
  8. }
  9. else
  10. {
  11. $out[$key] = $value;
  12. }
  13. }
  14. return $out;
  15. }

Report this snippet  

You need to login to post a comment.