I’m trying to echo the value stored in key = ‘Tipo’ from each sub-array.
foreach ($palabras as $key => $palabra) {
foreach ($palabra as $key2 => $meaning) {
echo $palabra[$key2]['Tipo'];
}
}
I’m sure my error is pretty simple, but I’m not sure what it is. The problem is that I get random characters instead of just the values.
Just so you know this is the original array:
Array
(
[0] => Array
(
[Palabra] => juan
)
[1] => Array
(
[Palabra] => es
[0] => Array
(
[Raiz] => ser
[Tipo] => verbo1
)
[1] => Array
(
[Raiz] => ser
[Tipo] => verbo2
)
)
[2] => Array
(
[Palabra] => un
[0] => Array
(
[Tipo] => articulo-indeterminado
)
)
[3] => Array
(
[Palabra] => adjetivo
[0] => Array
(
[Tipo] => Clase
[Clase] => Adjetivo
)
)
)
And this is what I get with my code:
jeverbo1verbo2uarticulo-indeterminadoaClase
http://www.ideone.com/cXVAe