Nested foreach to echo a key from sub-array?
<p>I'm trying to echo the value stored in key = 'Tipo' from each sub-array.</p>

<pre><code>foreach ($palabras as $key =&gt; $palabra) {
    foreach ($palabra as $key2 =&gt; $meaning) {
        echo $palabra[$key2]['Tipo'];
        }
}
</code></pre>

<p>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.</p>

<p>Just so you know this is the original array:</p>

<pre><code>Array
(
    [0] =&gt; Array
    (
        [Palabra] =&gt; juan
    )

[1] =&gt; Array
    (
        [Palabra] =&gt; es
        [0] =&gt; Array
            (
                [Raiz] =&gt; ser
                [Tipo] =&gt; verbo1
            )

        [1] =&gt; Array
            (
                [Raiz] =&gt; ser
                [Tipo] =&gt; verbo2
            )

    )

[2] =&gt; Array
    (
        [Palabra] =&gt; un
        [0] =&gt; Array
            (
                [Tipo] =&gt; articulo-indeterminado
            )

    )

[3] =&gt; Array
    (
        [Palabra] =&gt; adjetivo
        [0] =&gt; Array
            (
                [Tipo] =&gt; Clase
                [Clase] =&gt; Adjetivo
            )
     )
)
</code></pre>

<p>And this is what I get with my code:</p>

<p><code>jeverbo1verbo2uarticulo-indeterminadoaClase</code></p>
