Why php do not loop through my array?
<p>I have an array like this:</p>

<pre><code>$test = array(   array(
    'td' =&gt; array(
        '@attributes'=&gt; array('class' =&gt; 'tinh'),
        'a' =&gt; 'Dong Nai',
      ),
    ),   array(
    'td' =&gt; '4K1',
    ),   array(
    'td' =&gt; array(
        '@attributes'=&gt; array('class' =&gt; 'tinh'),
        'a' =&gt; 'Dong Nai',
      ),
    ),   array(
    'td' =&gt; array(
        '@attributes'=&gt; array('class' =&gt; 'tinh'),
        'a' =&gt; 'Dong Nai',
      ),
    ),   array(
    'td' =&gt; array(
        '@attributes'=&gt; array('class' =&gt; 'tinh'),
        'a' =&gt; 'Dong Nai',
      ),
    ),   array(
    'td' =&gt; array(
        '@attributes'=&gt; array('class' =&gt; 'tinh'),
        'a' =&gt; 'Dong Nai',
      ),
    ),   );
</code></pre>

<p>Then I loop $test like this:</p>

<pre><code>foreach ($test as $key=&gt;$value){   if ($value['td']['@attributes']['class'] == 'tinh'){
    echo '1';   } }
</code></pre>

<p>It only print '1'. </p>

<p>Would anybody please can explain this? How to view or show any php messge when run this script.</p>

<p>Thanks!</p>
