I have a php array like this.
Array
(
[first_year] => Array
(
[1] => Array
(
[0] => Array
(
[distiction] => , 2, 3, 4, 5, 6, , 8, 9
[name] => Mark
[status] => Pass with credit
)
)
[2] => Array
(
[0] => Array
(
[distiction] => , 2, 3, 4, 5, 6, 7, , 9
[name] => John
[status] =>
)
)
)
)
I got that data by print_r($dataArray[$academic_year][$major])
.
How can I check if $dataArray[$academic_year][$major][$year] and check if [first_year]
has values or not? I have already tried out empty()
, !array_filter()
and $dataArray[$academic_year][$major][$year] == []
.
But none of it working for me. Thank you.