I have the following array structure:
0 =>
array
'all_sessions_available' => boolean true
'all_sessions_unavailable' => boolean false
....
22 =>
array
'all_sessions_available' => boolean false
'all_sessions_unavailable' => boolean true
I am trying to remove the full array element if all_sessions_unavailable = true
I have the following code:
for ($i = 0; $i <= count($processData); $i++) {
if ($processData[$i]['all_sessions_unavailable'] === true) {
unset($processData[$i]);
}
}
However it removes all but the last array (22 in this case which happens to be the last array in the overall array if that makes any difference)
Is there something I'm doing wrong?