I have an array that looks like this:
$arr = array(
'abc' => array(
'subkey1' => '',
'subkey2' => false,
'subkey3' => 0,
...
),
'def' => array(
'subkey1' => '',
'subkey2' => 555,
'subkey3' => 0,
...
),
...
);
I want to unset all parent elements in which ALL subkeys have empty values, like 0, '', false, null. In my example abc needs to be unset.
Currently I'm manually checking within a foreach loop if each subkey is empty, but the if condition is huge because I have 8 subkeys :)
Is there a nicer alternative for this?
abcshould be unset in this case?