Recursive array reverse in php

Last updated on 14/07/2014
function array_reverse_recursive($arr) {
  foreach ($arr as $key => $val) {
    if (is_array($val))
      $arr[$key] = array_reverse_recursive($val);
    }
  return array_reverse($arr, TRUE);
}