I am new to PHP and am in need of help, how do I filter a dynamic multidimensional array by removing arrays that do not have a specific value?
Taking for example: In my code, I make a call in the database and create a dynamic array according to this structure.
Array
(
[0] => Array
(
[0] => Array
(
[nome] => Maria
[idade] => 22
)
[1] => Array
(
[casas_alugadas] => 'S'
[qtd] => 10
)
)
[1] => Array
(
[0] => Array
(
[nome] => Joao
[idade] => 28
)
[1] => Array
(
[casas_alugadas] => 'N'
)
)
)
I need to filter based on the values, if the array has the element "homes_alugadas == N", it is deleted and passed to the next, leaving only the index array 0, as done in the example. How would you do that?