PHP - array_chunk - can't adapt it to work properly
<p>Hello everybody I'm new in the php world still learning, and I'm completely lost. I've tried everything and read a lot of blogs but nothing helps me to figure out how to do it.
I have this code (below) which works perfectly.. it's dividing a long list in blocks of 5 elements, thanks to <code>&lt;ul&gt;</code> &amp; <code>&lt;li&gt;</code>'s.</p>

<pre><code>&lt;?php
$values = range(1, 31);
$rows = array_chunk($values, 5);


foreach ($rows as $row) {
    print "&lt;ul&gt;";
    foreach ($row as $value) {
        print "&lt;li&gt;" . $value . "&lt;/li&gt;";
    }
    print "&lt;/ul&gt;";
}
?&gt;
</code></pre>

<p>But When I try to merge it together with my other code (below), it stops to work. It only displays the <code>&lt;ul&gt;</code>'s and no data is putted in <code>&lt;li&gt;</code>'s which don't even display.</p>

<pre><code>&lt;?php 
        $product = Mage::getModel('catalog/product');
        $attributes = Mage::getResourceModel('eav/entity_attribute_collection')
        -&gt;setEntityTypeFilter($product-&gt;getResource()-&gt;getTypeId())
        -&gt;addFieldToFilter('attribute_code', 'manufacturer');
        $attribute = $attributes-&gt;getFirstItem()-&gt;setEntity($product-&gt;getResource());
        $manufacturers = $attribute-&gt;getSource()-&gt;getAllOptions(false);
?&gt;


&lt;ul&gt; 
&lt;?php foreach ($manufacturers as $manufacturer): ?&gt;
    &lt;li&gt;
        &lt;a href="/manufacturer/&lt;?php echo $manufacturer['label'] ?&gt;"&gt;
            &lt;?php echo $manufacturer['label'] ?&gt;
        &lt;/a&gt;
    &lt;/li&gt;
&lt;?php endforeach; ?&gt;
&lt;/ul&gt;
</code></pre>

<p>This is one of the variants I've tried (the one that doesn't show me a 500 error)</p>

<pre><code>&lt;?php
$rows = array_chunk($manufacturers, 5);


foreach ($manufacturers as $manufacturer) {
    echo "&lt;ul&gt;";
    foreach ($row as $manufacturer) {
        echo "&lt;li&gt;"  ?&gt; 
                &lt;a href="/manufacturer/&lt;?php echo $manufacturer['label'] ?&gt;"&gt;&lt;?php echo $manufacturer['label'] ?&gt;&lt;/a&gt;
&lt;?php   echo "&lt;/li&gt;"; ?&gt;
&lt;?php    }
    echo "&lt;/ul&gt;";
}
?&gt;
</code></pre>

<p>I know probably what I'm doing is completely wrong, but as I said I'm new still learning (I have a long way to go, I know.)</p>

<p>Any help will be more than appreciate. Thank you in advance!</p>

<p>EDITS:
    Array ( [value] => 15 [label] => Jordan )
    Array ( [value] => 19 [label] => Maison Scotch )
    Array ( [value] => 5 [label] => Museum )
    Array ( [value] => 17 [label] => Nike )
    Array ( [value] => 16 [label] => Nike Basket )
    Array ( [value] => 11 [label] => On Tour )
    Array ( [value] => 7 [label] => PeB )
    Array ( [value] => 14 [label] => Penfiled )
    Array ( [value] => 4 [label] => President's )
    Array ( [value] => 23 [label] => Scotch &amp; Soda )
    Array ( [value] => 12 [label] => Solovair )
    Array ( [value] => 13 [label] => Supra )
    Array ( [value] => 20 [label] => Vans )
    Array ( [value] => 18 [label] => Wood Wood ) </p>
