1print_r(deep_delete_keys($arr,'country'));
2
3function deep_delete_keys($arr, $keys) {
4 if (!is_array($keys)) $keys = array($keys);
5 $filteredArr = array_diff_key( $arr, array_flip( $keys ) );
6 foreach ($filteredArr as &$val) {
7 if (is_array($val)) {
8 $val = deep_delete_keys($val, $keys);
9 }
10 }
11 return $filteredArr;
12}