function filter_array($arr, $values = ['',[]]){ foreach ($arr as $k => $v) { if (is_array($v) && count($v)>0) { $arr[$k] = filter_array($v, $values); } foreach ($values as $value) { if ($v === $value) { unset($arr[$k]); break; } } } return $arr; }
2022-03-07 21:14:24
function filter_array($arr, $values = ['',[]]){ foreach ($arr as $k => $v) { if (is_array($v) && count($v)>0) { $arr[$k] = filter_array($v, $values); } foreach ($values as $value) { if ($v === $value) { unset($arr[$k]); break; } } } return $arr; }