CMXX - Catalog API

This commit is contained in:
“VeLiTi”
2025-01-30 09:28:50 +01:00
parent 661783270a
commit a669b2fadf
19 changed files with 579 additions and 118 deletions

View File

@@ -2961,4 +2961,26 @@ function generateLanguageFile($language_key,$token){
}
}
}
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Removekeys from array ++++++++++++++
// +++++++++++++++++++++++++++++++++++++++++++++++++++++++
function removeKeysRecursive(array &$array, array $keysToRemove): void {
foreach ($array as $key => &$value) {
// Remove the key if it exists in our removal list
if (in_array($key, $keysToRemove, true)) {
unset($array[$key]);
continue;
}
// If value is an array, recursively process it
if (is_array($value)) {
removeKeysRecursive($value, $keysToRemove);
// If array is empty after processing, remove it
if (empty($value)) {
unset($array[$key]);
}
}
}
}