I'm having some troubles getting information from an array. I'm in need to get all information per key basis but I can't get it.
I have this array:
Array(
[en] => Array(
[a] => Array(
[0] => [C][C]
[1] => [L][L][C]
) [b] => Array(
[0] => Tackle
[1] => RazorLeaf
) [c] => Array(
[0] =>
[1] =>
) [d] => Array(
[0] => 20
[1] => 50
)
) [pt] => Array(
[a] => Array(
[0] => [C][C]
) [b] => Array(
[0] => Pontapé
) [c] => Array(
[0] =>
) [d] => Array(
[0] => 20
)
)
)
In a foreach (or multiple), I'm in need to get [en][a][0], [en][b][0], [en][c][0] and [en][d][0] to insert data into database.
In the next loop is supposed to get [en][a][1], [en][b][1], [en][c][1] and [en][d][1] .
Last but not least, after change from [en] to [pt] it should get [pt][a][0], [pt][b][0], [pt][c][0] and [pt][d][0]
My approach:
foreach($result as $language => $index){
foreach($index as $attinfo => $index2){
//echo "$language <br/> $attinfo <br/>";
foreach($index2 as $valorfinal => $index3){
echo $index[$attinfo][$valorfinal][$index3]."<br/>";
}
}
}
My approach seems not to work as expected. Could someone guide me please? I would like to save in vars each key to then save them in database in each foreach loop. Thanks.
foreach()to get that