I've got an array I use in a FormValidator class, but at some point I end up with an array sort of like the following. But I would like to remove all empty arrays from that array so that in my validation it's not gonna check for values inside the empty array, which is inefficient.
Is there a function to remove empty arrays from multidimensional arrays?
I know about array_filter() but that seems to only work with array element values.
array(2)
{
["recaptcha_response_field"]=>
array(0) {
}
["terms"]=>
array(0) {
}
}