In a list of books within a% multidimensional%, every array
has a different column category , I would like to search this sub_array
for a category > for example:
Array "livros"
(
[Livro 1] => Array
(
[titulo] => Bleach
[resumo] => xxx
[categoria] => Ação, Comédia...
)
[Livro 2] => Array
(
[titulo] => Titulo livro 2
[resumo] => xxx
[categoria] => Ação, Psicológico, Romance ...
)
[livro 3] => Array
(
[titulo] => Titulo do livro 3
[resumo] => xxx
[categoria] => Romance, Vampiros ...
)
)
I would like to search for example which books fit the "Romance" category, I did some research and found what might be the solution, but for some reason it is not working, that would be this function:
$romances = array_keys(array_column($livros, 'categoria'), 'Romance');
The above function does not bring any value, just an empty% void, what am I doing wrong?