function multiarray_keys($ar) { foreach($ar as $k => $v) { $keys[] = $k; if (is_array($ar[$k])) $keys = array_merge($keys, func::multiarray_keys($ar[$k])); } return $keys; }