ArrayHelper.php 302 B

1234567891011121314151617
  1. <?php
  2. namespace fphammerle\helpers;
  3. class ArrayHelper
  4. {
  5. /**
  6. * @return array
  7. */
  8. public static function flatten(array $arr)
  9. {
  10. return iterator_to_array(
  11. new \RecursiveIteratorIterator(new \RecursiveArrayIterator($arr)),
  12. false
  13. );
  14. }
  15. }