0
Good afternoon, my question is this::
I own a array
of genera. Code below:
$generos = array(
'filmes' => array(
1 => 'Ação'
),
'series' => array(
1 => 'Artes Marciais'
),
'animes' => array(
1 => 'Aventura'
)
);
I need to return this array
showing all the codes inside it, example: ela irá mostrar todos os valores disponíveis dentro de um dos gêneros, vamos supor que você escolheu o gênero: FILMES, é necessário que me retorne todos os valores dentro dessa array
, this way above I am not knowing how to return, because it has an array and a sub-array. I can only return the complete values of an array when a array
is like this:
$generos = array('filmes' => 'Ação', 'series' => 'Artes Marciais', 'animes' => 'Aventura');
foreach($generos as $key => $value) {
echo $value.', ';
}
Ai returns to me Ação, Artes Marciais, Aventura,
, but when I use subarray as it is in the first code, I cannot make the return, I would like help.
God, you helped me so much, thank you :D
– meuFlix
It only takes me one more doubt, as I do inside this same code, instead of taking the value, take the position, example: 1 = Action, but I do not want the
Ação
, I want the number1
, how should I do?– meuFlix
the number 1 for example just exchange the echo $value for the echo $key; I put more examples check it out.
– Rodrigo Bezerra Rodrigues
It is I read, thank you very much helped me too :D
– meuFlix
Starch ;)
– Rodrigo Bezerra Rodrigues