0
I am a beginner in PHP and I am in need of a help, as I do to filter a dynamic multidimensional array by removing the 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 "rented houses == N", it is deleted and is passed to the next one, leaving only the index array 0, as done in the example. How would you do that?
Cool, that way I didn’t know, but she treats the array and changes it? I need to remove these array, without changing the structure(Remove the array and keep the main array to perform the sets in a foreach)
– vic.py
@Vic.py The structure of the array is maintained.
– Valdeir Psr
@Vic.py managed to solve?
– Valdeir Psr
I managed without problems thanks so much for the help!
– vic.py