Basically, I have a multidimensional array, and I need to check whether or not it is simply empty, or not.
I currently have an if
statement trying to do thi
Combine array_filter()
and array_map()
for result. ( Result Test )
[],
'1'=> [
'question1',
'answer1',
'answer2',
'answer3',
'answer4'
],
'2'=> [
'question1',
'answer1',
'answer2',
'answer3',
'answer4'
]
];
$arrayEmpty = [
'0' => [],
'1' => [
'1' => '',
'2' => '',
'3' => ''
]
];
$resultData = array_filter(array_map('array_filter', $arrayData));
$resultEmpty = array_filter(array_map('array_filter', $arrayEmpty));
var_dump('Data', empty($resultData));
var_dump('Empty', empty($resultEmpty));